lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev (more patch) minore cleanup


From: dickey
Subject: Re: lynx-dev (more patch) minore cleanup
Date: Wed, 7 Apr 1999 07:24:36 -0400 (EDT)

> >From LYMain.c : 
> static int cache_fun ARGS3( 
>        Parse_Args_Type*,       p GCC_UNUSED, 
>        char **,                argv GCC_UNUSED, 
>        char *,                 next_arg) 
>  
> What all this GCC_UNUSED staff for? 

it's because the functions all have the same number of parameters (unless
you've rewritten them).  if you mix pointers, it won't compile on some
platforms (gcc is too forgiving to qualify here as an ANSI compiler).

> Seems command-line options may have one argument only or none 
> so *p and **argv really unused here. The patch attached. 
>  
> Also minore (and obvious) fixes for src/LYReadCFG.c and WWW/... /HTFile.c 
> over all my previous patches. 
>  
>  
> diff -u old/lymain.c ./lymain.c 
> --- old/lymain.c        Mon Apr  5 23:55:22 1999 
> +++ ./lymain.c  Tue Apr  6 03:35:06 1999 
> @@ -1875,7 +1875,7 @@ 
>   */ 
>  
>  struct parse_args_type; 
> -typedef int (*ParseFunc) PARAMS((struct parse_args_type *, char **, char 
> *)); 
> +typedef int (*ParseFunc) PARAMS((char *)); 
>  
>  typedef union { 
>         BOOLEAN * set_value; 
> @@ -1968,9 +1968,7 @@ 
>  } 
>  
>  /* -anonymous */ 
> -static int anonymous_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int anonymous_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>     /* 
> @@ -1985,9 +1983,7 @@ 
>  } 
>  
>  /* -assume_charset */ 
> -static int assume_charset_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int assume_charset_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      UCLYhndl_for_unspec = safeUCGetLYhndl_byMIME(next_arg); 
> @@ -2001,9 +1997,7 @@ 
>  } 
>  
>  /* -assume_local_charset */ 
> -static int assume_local_charset_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int assume_local_charset_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      UCLYhndl_HTFile_for_unspec = safeUCGetLYhndl_byMIME(next_arg); 
> @@ -2011,9 +2005,7 @@ 
>  } 
>  
>  /* -assume_unrec_charset */ 
> -static int assume_unrec_charset_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int assume_unrec_charset_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      UCLYhndl_for_unrec = safeUCGetLYhndl_byMIME(next_arg); 
> @@ -2021,9 +2013,7 @@ 
>  } 
>  
>  /* -auth */ 
> -static int auth_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int auth_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      parse_authentication(next_arg, authentication_info); 
> @@ -2031,9 +2021,7 @@ 
>  } 
>  
>  /* -base */ 
> -static int base_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int base_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      /* 
> @@ -2053,9 +2041,7 @@ 
>  
>  #ifdef USE_SLANG 
>  /* -blink */ 
> -static int blink_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int blink_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      Lynx_Color_Flags |= SL_LYNX_USE_BLINK; 
> @@ -2064,9 +2050,7 @@ 
>  #endif 
>  
>  /* -cache */ 
> -static int cache_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int cache_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg != 0) 
> @@ -2080,9 +2064,7 @@ 
>  } 
>  
>  /* -child */ 
> -static int child_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int child_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      child_lynx = TRUE; 
> @@ -2092,9 +2074,7 @@ 
>  
>  #ifdef USE_SLANG 
>  /* -color */ 
> -static int color_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int color_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      Lynx_Color_Flags |= SL_LYNX_USE_COLOR; 
> @@ -2107,9 +2087,7 @@ 
>  #endif 
>  
>  /* -crawl */ 
> -static int crawl_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int crawl_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      crawl = TRUE; 
> @@ -2118,9 +2096,7 @@ 
>  } 
>  
>  /* -display */ 
> -static int display_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int display_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg != 0) { 
> @@ -2133,9 +2109,7 @@ 
>  } 
>  
>  /* -dump */ 
> -static int dump_output_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int dump_output_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      dump_output_immediately = TRUE; 
> @@ -2144,9 +2118,7 @@ 
>  } 
>  
>  /* -editor */ 
> -static int editor_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int editor_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg != 0) 
> @@ -2156,9 +2128,7 @@ 
>  } 
>  
>  /* -error_file */ 
> -static int error_file_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int error_file_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      /* 
> @@ -2172,9 +2142,7 @@ 
>  
>  #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS) 
>  /* -exec */ 
> -static int exec_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int exec_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>  #ifndef NEVER_ALLOW_REMOTE_EXEC 
> @@ -2187,9 +2155,7 @@ 
>  #endif 
>  
>  /* -get_data */ 
> -static int get_data_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int get_data_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      /* 
> @@ -2232,9 +2198,7 @@ 
>  } 
>  
>  /* -help */ 
> -static int help_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int help_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      print_help_and_exit (0); 
> @@ -2242,9 +2206,7 @@ 
>  } 
>  
>  /* -hiddenlinks */ 
> -static int hiddenlinks_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int hiddenlinks_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg != 0) { 
> @@ -2264,9 +2226,7 @@ 
>  } 
>  
>  /* -homepage */ 
> -static int homepage_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int homepage_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg != 0) { 
> @@ -2277,9 +2237,7 @@ 
>  } 
>  
>  /* -mime_header */ 
> -static int mime_header_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int mime_header_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      /* 
> @@ -2295,9 +2253,7 @@ 
>  
>  #ifndef DISABLE_NEWS 
>  /* -newschunksize */ 
> -static int newschunksize_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int newschunksize_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg != 0) { 
> @@ -2313,9 +2269,7 @@ 
>  } 
>  
>  /* -newsmaxchunk */ 
> -static int newsmaxchunk_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int newsmaxchunk_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg) { 
> @@ -2332,9 +2286,7 @@ 
>  #endif /* not DISABLE_NEWS */ 
>  
>  /* -nobrowse */ 
> -static int nobrowse_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int nobrowse_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>     HTDirAccess = HT_DIR_FORBID; 
> @@ -2342,9 +2294,7 @@ 
>  } 
>  
>  /* -nocolor */ 
> -static int nocolor_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int nocolor_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      LYShowColor = SHOW_COLOR_NEVER; 
> @@ -2356,9 +2306,7 @@ 
>  } 
>  
>  /* -nopause */ 
> -static int nopause_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int nopause_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      InfoSecs = 0; 
> @@ -2368,9 +2316,7 @@ 
>  } 
>  
>  /* -pauth */ 
> -static int pauth_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int pauth_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      parse_authentication(next_arg, proxyauth_info); 
> @@ -2378,9 +2324,7 @@ 
>  } 
>  
>  /* -post_data */ 
> -static int post_data_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int post_data_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      /* 
> @@ -2421,9 +2365,7 @@ 
>  } 
>  
>  /* -restrictions */ 
> -static int restrictions_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int restrictions_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      static CONST char *Usage[] = { 
> @@ -2518,9 +2460,7 @@ 
>  } 
>  
>  /* -selective */ 
> -static int selective_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int selective_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>     HTDirAccess = HT_DIR_SELECTIVE; 
> @@ -2528,9 +2468,7 @@ 
>  } 
>  
>  /* -source */ 
> -static int source_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int source_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      dump_output_immediately = TRUE; 
> @@ -2541,9 +2479,7 @@ 
>  } 
>  
>  /* -traversal */ 
> -static int traversal_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int traversal_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      traversal = TRUE; 
> @@ -2557,9 +2493,7 @@ 
>  } 
>  
>  /* -version */ 
> -static int version_fun ARGS3( 
> -       Parse_Args_Type *,      p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int version_fun ARGS1( 
>         char *,                 next_arg GCC_UNUSED) 
>  { 
>      SetOutputMode( O_TEXT ); 
> @@ -2587,9 +2521,7 @@ 
>  } 
>  
>  /* -width */ 
> -static int width_fun ARGS3( 
> -       Parse_Args_Type*,       p GCC_UNUSED, 
> -       char **,                argv GCC_UNUSED, 
> +static int width_fun ARGS1( 
>         char *,                 next_arg) 
>  { 
>      if (next_arg != 0) { 
> @@ -3277,7 +3209,7 @@ 
>         case FUNCTION_ARG: 
>              fun = q->fun_value; 
>              if (0 != fun) { 
> -                if (-1 == (*fun) (p, argv, next_arg)) { 
> +                if (-1 == (*fun) (next_arg)) { 
>                  } 
>              } 
>              break; 
>  
> diff -u old/lyreadcf.c ./lyreadcf.c 
> --- old/lyreadcf.c      Mon Apr  5 23:36:06 1999 
> +++ ./lyreadcf.c        Tue Apr  6 15:42:40 1999 
> @@ -1372,7 +1372,7 @@ 
>  PUBLIC int lynx_cfg_infopage ARGS1( 
>      document *,                newdoc) 
>  { 
> -    char tempfile[LY_MAXPATH]; 
> +    static char tempfile[LY_MAXPATH]; 
>      static char *local_url;  /* static! */ 
>      DocAddress WWWDoc;  /* need on exit */ 
>      char *temp = 0; 
> @@ -1421,15 +1421,15 @@ 
>                 return(NOT_FOUND); 
>  
>  
> -       /* FIXME: probably remove obsolete temp file just now (before exit)? 
> */ 
> - 
> -       /* now set up the flag and fall down to create a new LYNXCFG:/ page 
> */ 
> +       /*  now set up the flag and fall down to create a new LYNXCFG:/ page 
> */ 
>          local_url = 0;  /* see below */ 
>      } 
>  #endif /* !NO_CONFIG_INFO */ 
>  
>  
>      if (local_url == 0) { 
> + 
> +       LYRemoveTemp(tempfile); 
>         if ((fp0 = LYOpenTemp(tempfile, HTML_SUFFIX, "w")) == NULL) { 
>             HTAlert(CANNOT_OPEN_TEMP); 
>             return(NOT_FOUND); 
>  
>  
> diff -u old/htfile.c ./htfile.c 
> --- old/htfile.c        Mon Apr  5 16:05:18 1999 
> +++ ./htfile.c  Tue Apr  6 15:31:44 1999 
> @@ -1462,6 +1462,7 @@ 
>             PUTS("/"); 
>         } 
>         END(HTML_A); 
> +       PUTS("\n"); 
>      } 
>  #endif /* !NO_PARENT_DIR_REFERENCE */ 
>  
> @@ -1692,11 +1693,15 @@ 
>                                 if (state != test) { 
>  #ifndef LONG_LIST 
>                                     if (dir_list_style == FILES_FIRST) { 
> -                                      if (state == 'F') 
> +                                      if (state == 'F') { 
>                                           END(HTML_DIR); 
> +                                         PUTS("\n"); 
> +                                       } 
>                                     } else if (dir_list_style != MIXED_STYLE) 
> -                                      if (state == 'D') 
> +                                      if (state == 'D') { 
>                                           END(HTML_DIR); 
> +                                         PUTS("\n"); 
> +                                       } 
>  #endif /* !LONG_LIST */ 
>                                     state = 
>                                        (*(char 
> *)(HTBTree_object(next_element)) 
> @@ -1710,16 +1715,20 @@ 
>                                        END(HTML_EM); 
>                                     } 
>                                     END(HTML_H2); 
> +                                   PUTS("\n"); 
>  #ifndef LONG_LIST 
>                                     START(HTML_DIR); 
> +                                   PUTS("\n"); 
>  #endif /* !LONG_LIST */ 
>                                 } 
>  #else 
>                                 if (state != *(char *)(HTBTree_object( 
>                                                          next_element))) { 
>  #ifndef LONG_LIST 
> -                                   if (state == 'D') 
> +                                   if (state == 'D') { 
>                                         END(HTML_DIR); 
> +                                       PUTS("\n"); 
> +                                   } 
>  #endif /* !LONG_LIST */ 
>                                     state = 
>                                       (*(char 
> *)(HTBTree_object(next_element)) 
> @@ -1731,8 +1740,10 @@ 
>                                         : LABEL_FILES); 
>                                     END(HTML_EM); 
>                                     END(HTML_H2); 
> +                                   PUTS("\n"); 
>  #ifndef LONG_LIST 
>                                     START(HTML_DIR); 
> +                                   PUTS("\n"); 
>  #endif /* !LONG_LIST */ 
>                                 } 
>  #endif /* DIRED_SUPPORT */ 
> @@ -1755,6 +1766,7 @@ 
>                                 FREE(file_extra); 
>                             } 
>                             MAYBE_END(HTML_LI); 
> +                           PUTS("\n"); 
>  #endif /* LONG_LIST */ 
>  
>                             next_element = HTBTree_next(bt, next_element); 
> @@ -1789,7 +1801,7 @@ 
>                                 END(HTML_DIR); 
>  #endif /* !LONG_LIST */ 
>                         } 
> -                   }  /* printing out the tree in order done */ 
> +                   }  /* end printing out the tree in order */ 
>  
>                     closedir(dp); 
>                     FREE(logical); 
>  
>  


-- 
Thomas E. Dickey
address@hidden
http://www.clark.net/pub/dickey

reply via email to

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