util-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Francesco Cosoleto <cosoleto@gmail.com>
To: util-linux@vger.kernel.org
Cc: Francesco Cosoleto <cosoleto@gmail.com>
Subject: [PATCH] agetty: add static and const qualifiers
Date: Thu, 15 Dec 2011 20:02:06 +0100	[thread overview]
Message-ID: <1323975726-21812-1-git-send-email-cosoleto@gmail.com> (raw)

Remove also a static qualifier in main() function.

Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
---
 term-utils/agetty.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 041e1f7..86902a1 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -190,7 +190,7 @@ struct chardata {
 };
 
 /* Initial values for the above. */
-struct chardata init_chardata = {
+static const struct chardata init_chardata = {
 	DEF_ERASE,		/* default erase character */
 	DEF_KILL,		/* default kill character */
 	13,			/* default eol char */
@@ -203,7 +203,7 @@ struct Speedtab {
 	speed_t code;
 };
 
-static struct Speedtab speedtab[] = {
+static const struct Speedtab speedtab[] = {
 	{50, B50},
 	{75, B75},
 	{110, B110},
@@ -282,7 +282,7 @@ int main(int argc, char **argv)
 	char *username = NULL;			/* login name, given to /bin/login */
 	struct chardata chardata;		/* will be set by get_logname() */
 	struct termios termios;			/* terminal mode bits */
-	static struct options options = {
+	struct options options = {
 		.flags  =  F_ISSUE,		/* show /etc/issue (SYSV_STYLE) */
 		.login  =  _PATH_LOGIN,		/* default login program */
 		.tty    = "tty1",		/* default tty line */
@@ -1636,7 +1636,7 @@ static int caps_lock(char *s)
 /* Convert speed string to speed code; return 0 on failure. */
 static speed_t bcode(char *s)
 {
-	struct Speedtab *sp;
+	const struct Speedtab *sp;
 	long speed = atol(s);
 
 	for (sp = speedtab; sp->speed; sp++)
-- 
1.7.3.4


             reply	other threads:[~2011-12-15 19:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-15 19:02 Francesco Cosoleto [this message]
2011-12-16 11:55 ` [PATCH] agetty: add static and const qualifiers Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1323975726-21812-1-git-send-email-cosoleto@gmail.com \
    --to=cosoleto@gmail.com \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).