lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev patches for cleanup of parse_arg


From: John E. Davis
Subject: Re: lynx-dev patches for cleanup of parse_arg
Date: Sun, 26 Apr 1998 04:27:20 -0400

On Sat, 25 Apr 1998 03:27:42 -0400, "John E. Davis" <address@hidden> said:
>   I spent several hours tonight cleaning up the parse_arg function
>in LYMain.c.  New features will require more command line options, and

My patch has one problem: BOOLEAN is not an int like I assumed.  Here
is a patch to my parse_arg patch:

--- parsearg.c.ORIG     Sun Apr 26 04:24:48 1998
+++ parsearg.c  Sun Apr 26 04:23:14 1998
@@ -13,9 +13,9 @@
    char *name;
    int type;
 #define IGNORE_ARG             0x000
-#define TOGGLE_ARG             0x001
-#define SET_ARG                        0x002
-#define UNSET_ARG              0x003
+#define TOGGLE_ARG             0x001  /* BOOLEAN */
+#define SET_ARG                        0x002  /* BOOLEAN */
+#define UNSET_ARG              0x003  /* BOOLEAN */
 #define FUNCTION_ARG           0x004
 #define ALLOC_STRING_ARG       0x005
 #define INT_ARG                        0x006
@@ -1243,18 +1243,18 @@
        switch (p->type & ARG_TYPE_MASK)
          {
           case TOGGLE_ARG:
-            if (NULL != (int *)p->value)
-              *(int *)p->value = !(*(int *)p->value);
+            if (NULL != (BOOLEAN *)p->value)
+              *(BOOLEAN *)p->value = !(*(BOOLEAN *)p->value);
             break;
             
           case SET_ARG:
-            if (NULL != (int *)p->value)
-              *(int *)p->value = TRUE;
+            if (NULL != (BOOLEAN *)p->value)
+              *(BOOLEAN *)p->value = TRUE;
             break;
 
           case UNSET_ARG:
-            if (NULL != (int *)p->value)
-              *(int *)p->value = TRUE;
+            if (NULL != (BOOLEAN *)p->value)
+              *(BOOLEAN *)p->value = TRUE;
             break;
 
           case FUNCTION_ARG:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]