diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-05-08 21:15:08 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-05-18 06:41:36 -0400 |
commit | 91f1119528b57f94d178f0cfb12efafd0c90bbc9 (patch) | |
tree | b98c68ebf25eb4c477fa99c2548d2c8a4804a4c0 /src/Initialize.c | |
parent | 43a65ae23370e0f7fb427e96c6d9037d8fa1af35 (diff) |
fixes cppcheck "style" warnings (mostly variable-scope)
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/Initialize.c')
-rw-r--r-- | src/Initialize.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/Initialize.c b/src/Initialize.c index 363920e..2adf1fd 100644 --- a/src/Initialize.c +++ b/src/Initialize.c @@ -360,7 +360,6 @@ static String GetRootDirName( #ifdef X_NEEDS_PWPARAMS _Xgetpwparams pwparams; #endif - struct passwd *pw; static char *ptr; if (len <= 0 || dest == NULL) @@ -370,6 +369,7 @@ static String GetRootDirName( (void) strncpy (dest, ptr, (size_t)(len-1)); dest[len-1] = '\0'; } else { + struct passwd *pw; if ((ptr = getenv("USER"))) pw = _XGetpwnam(ptr,pwparams); else @@ -425,16 +425,16 @@ static void CombineUserDefaults( Display *dpy, XrmDatabase *pdb) { -#ifdef __MINGW32__ - const char *slashDotXdefaults = "/Xdefaults"; -#else - const char *slashDotXdefaults = "/.Xdefaults"; -#endif char *dpy_defaults = XResourceManagerString(dpy); if (dpy_defaults) { XrmCombineDatabase(XrmGetStringDatabase(dpy_defaults), pdb, False); } else { +#ifdef __MINGW32__ + const char *slashDotXdefaults = "/Xdefaults"; +#else + const char *slashDotXdefaults = "/.Xdefaults"; +#endif char filename[PATH_MAX]; (void) GetRootDirName(filename, PATH_MAX - (int)strlen (slashDotXdefaults) - 1); @@ -648,12 +648,11 @@ static void _MergeOptionTables( Cardinal *num_dst) { XrmOptionDescRec *table, *endP; - register XrmOptionDescRec *opt1, *whereP, *dstP; - register const XrmOptionDescRec *opt2; + XrmOptionDescRec *opt1, *dstP; + const XrmOptionDescRec *opt2; int i1; Cardinal i2; int dst_len, order; - Boolean found; enum {Check, NotSorted, IsSorted} sort_order = Check; *dst = table = (XrmOptionDescRec*) @@ -666,6 +665,9 @@ static void _MergeOptionTables( } endP = &table[dst_len = (int)num_src1]; for (opt2 = src2, i2= 0; i2 < num_src2; opt2++, i2++) { + XrmOptionDescRec *whereP; + Boolean found; + found = False; whereP = endP-1; /* assume new option goes at the end */ for (opt1 = table, i1 = 0; i1 < dst_len; opt1++, i1++) { |