about summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorWayne Davison <wayned@users.sourceforge.net>2004-05-28 19:20:01 +0000
committerWayne Davison <wayned@users.sourceforge.net>2004-05-28 19:20:01 +0000
commit7c4ac8d60b59ae60577ebe8c273f74b90cf93e50 (patch)
treea3c81a0ab89fb4463cc10072f6db8eaba4706807 /Src/params.c
parentf297798397f570edd4e2a7933edaebe19489129c (diff)
downloadzsh-7c4ac8d60b59ae60577ebe8c273f74b90cf93e50.tar.gz
zsh-7c4ac8d60b59ae60577ebe8c273f74b90cf93e50.tar.xz
zsh-7c4ac8d60b59ae60577ebe8c273f74b90cf93e50.zip
- Added missing struct initializers to two last-in-list values.
- Fixed a few signed/unsigned comparisons.
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/Src/params.c b/Src/params.c
index 72e05f9a8..3726fe720 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -224,7 +224,8 @@ IPDEF8("MODULE_PATH", &module_path, "module_path", PM_DONTIMPORT|PM_RESTRICTED),
 #define IPDEF9(A,B,C) IPDEF9F(A,B,C,0)
 IPDEF9F("*", &pparams, NULL, PM_ARRAY|PM_SPECIAL|PM_DONTIMPORT|PM_READONLY),
 IPDEF9F("@", &pparams, NULL, PM_ARRAY|PM_SPECIAL|PM_DONTIMPORT|PM_READONLY),
-{NULL, NULL},
+{NULL,NULL,0,BR(NULL),SFN(NULL),GFN(NULL),NULL,0,NULL,NULL,NULL,0},
+
 #define IPDEF10(A,B,C) {NULL,A,PM_ARRAY|PM_SPECIAL,BR(NULL),SFN(C),GFN(B),stdunsetfn,10,NULL,NULL,NULL,0}
 
 /* The following parameters are not available in sh/ksh compatibility *
@@ -252,7 +253,7 @@ IPDEF9F("path", &path, "PATH", PM_RESTRICTED),
 
 IPDEF10("pipestatus", pipestatgetfn, pipestatsetfn),
 
-{NULL, NULL}
+{NULL,NULL,0,BR(NULL),SFN(NULL),GFN(NULL),NULL,0,NULL,NULL,NULL,0},
 };
 
 /*
@@ -3335,7 +3336,7 @@ findenv(char *name, int *pos)
 
 
     eq = strchr(name, '=');
-    nlen = eq ? eq - name : strlen(name);
+    nlen = eq ? eq - name : (int)strlen(name);
     for (ep = environ; *ep; ep++) 
 	if (!strncmp (*ep, name, nlen) && *((*ep)+nlen) == '=') {
 	    if (pos)
@@ -3709,6 +3710,8 @@ static const struct paramtypes pmtypes[] = {
     { PM_EXPORTED, "exported", 'x', 0}
 };
 
+#define PMTYPES_SIZE ((int)(sizeof(pmtypes)/sizeof(struct paramtypes)))
+
 /**/
 mod_export void
 printparamnode(HashNode hn, int printflags)
@@ -3727,8 +3730,7 @@ printparamnode(HashNode hn, int printflags)
 	int doneminus = 0, i;
 	const struct paramtypes *pmptr;
 
-	for (pmptr = pmtypes, i = 0; i < sizeof(pmtypes)/sizeof(*pmptr);
-	     i++, pmptr++) {
+	for (pmptr = pmtypes, i = 0; i < PMTYPES_SIZE; i++, pmptr++) {
 	    int doprint = 0;
 	    if (pmptr->flags & PMTF_TEST_LEVEL) {
 		if (p->level)