]> sjero.net Git - wget/commitdiff
[svn] Allow Wget to be compiled with a K&R compiler.
authorhniksic <devnull@localhost>
Thu, 11 Apr 2002 17:49:32 +0000 (10:49 -0700)
committerhniksic <devnull@localhost>
Thu, 11 Apr 2002 17:49:32 +0000 (10:49 -0700)
Published in <sxszo0af9k6.fsf@florida.arsdigita.de>.

src/ChangeLog
src/cookies.c
src/ftp.h
src/hash.c
src/http.c
src/netrc.c
src/progress.c

index 24227f9925ca8b92d733574b98edb8bff786d211..f84d5294e3180ffb3b43d32ef39b9dbf59bb3ea6 100644 (file)
@@ -1,3 +1,29 @@
+2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * progress.c (struct progress_implementation): Use PARAMS when
+       declaring the parameters of *create, *update, *finish, and
+       *set_params.
+
+       * netrc.c: Ditto.
+
+       * http.c: Reformat some function definitions so that ansi2knr can
+       read them.
+
+       * hash.c (struct hash_table): Use the PARAMS macro around
+       parameters in the declaration of hash_function and test_function.
+       (prime_size): Spell 2580823717UL and 3355070839UL as (unsigned
+       long)0x99d43ea5 and (unsigned long)0xc7fa5177 respectively, so
+       that pre-ANSI compilers can read them.
+       (find_mapping): Use PARAMS when declaring EQUALS.
+       (hash_table_put): Ditto.
+
+       * ftp.h: Wrap the parameters of ftp_index declaration in PARAMS.
+
+       * cookies.c (cookie_new): Use (unsigned long)0 instead of 0UL,
+       which was unsupported by pre-ANSI compilers.
+
+       From Nelson H. F. Beebe <beebe@math.utah.edu>, for the most part.
+
 2002-04-11  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * url.c (url_filename): Use compose_file_name regardless of
index 411160ee8f27aef775941efc3f2604a206512c5a..18e6c8f9f11ddfcd4ef4f11187c857a3de5d7389 100644 (file)
@@ -84,7 +84,7 @@ cookie_new (void)
 
   /* If we don't know better, assume cookie is non-permanent and valid
      for the entire session. */
-  cookie->expiry_time = ~0UL;
+  cookie->expiry_time = ~(unsigned long)0;
 
   /* Assume default port. */
   cookie->port = 80;
index 7e17f29ca69fb1936402c524d3a4d8bf33db9fa5..b13a319252f47afdf242f808eaa25796f3cb85bc 100644 (file)
--- a/src/ftp.h
+++ b/src/ftp.h
@@ -107,7 +107,7 @@ enum wget_ftp_fstatus
 struct fileinfo *ftp_parse_ls PARAMS ((const char *, const enum stype));
 uerr_t ftp_loop PARAMS ((struct url *, int *));
 
-uerr_t ftp_index (const char *, struct url *, struct fileinfo *);
+uerr_t ftp_index PARAMS ((const char *, struct url *, struct fileinfo *));
 
 char ftp_process_type PARAMS ((const char *));
 
index ecfc96dd819a9c442a89d7826d3af117993705c1..0a7c2408d2155a2ac35acbcb0790b3fd7dd35268 100644 (file)
@@ -136,8 +136,8 @@ struct mapping {
 };
 
 struct hash_table {
-  unsigned long (*hash_function) (const void *);
-  int (*test_function) (const void *, const void *);
+  unsigned long (*hash_function) PARAMS ((const void *));
+  int (*test_function) PARAMS ((const void *, const void *));
 
   int size;                    /* size of the array */
   int count;                   /* number of non-empty, non-deleted
@@ -177,7 +177,8 @@ prime_size (int size)
     10445899, 13579681, 17653589, 22949669, 29834603, 38784989,
     50420551, 65546729, 85210757, 110774011, 144006217, 187208107,
     243370577, 316381771, 411296309, 534685237, 695090819, 903618083,
-    1174703521, 1527114613, 1985248999, 2580823717UL, 3355070839UL
+    1174703521, 1527114613, 1985248999,
+    (unsigned long)0x99d43ea5, (unsigned long)0xc7fa5177
   };
   int i;
   for (i = 0; i < ARRAY_SIZE (primes); i++)
@@ -236,7 +237,7 @@ find_mapping (struct hash_table *ht, const void *key)
   struct mapping *mappings = ht->mappings;
   int size = ht->size;
   struct mapping *mp = mappings + HASH_POSITION (ht, key);
-  int (*equals) (const void *, const void *) = ht->test_function;
+  int (*equals) PARAMS ((const void *, const void *)) = ht->test_function;
 
   LOOP_NON_EMPTY (mp, mappings, size)
     if (equals (key, mp->key))
@@ -336,7 +337,7 @@ hash_table_put (struct hash_table *ht, const void *key, void *value)
 {
   struct mapping *mappings = ht->mappings;
   int size = ht->size;
-  int (*equals) (const void *, const void *) = ht->test_function;
+  int (*equals) PARAMS ((const void *, const void *)) = ht->test_function;
 
   struct mapping *mp = mappings + HASH_POSITION (ht, key);
 
index 0e5168a19a1282f91c27e9dd3d3b74ec900c0588..6dacacab060c68d1b03101e4e5c3dae5bd6a0e6b 100644 (file)
@@ -313,13 +313,15 @@ invalidate_persistent (void)
 
    If a previous connection was persistent, it is closed. */
 
-static void
-register_persistent (const char *host, unsigned short port, int fd
 #ifdef HAVE_SSL
-                    , SSL *ssl
-#endif
-                    )
+static void
+register_persistent (const char *host, unsigned short port, int fd, SSL *ssl)
 {
+#else
+static void
+register_persistent (const char *host, unsigned short port, int fd)
+{
+#endif
   if (pc_active_p)
     {
       if (pc_last_fd == fd)
@@ -375,13 +377,15 @@ register_persistent (const char *host, unsigned short port, int fd
 /* Return non-zero if a persistent connection is available for
    connecting to HOST:PORT.  */
 
-static int
-persistent_available_p (const char *host, unsigned short port
 #ifdef HAVE_SSL
-                       , int ssl
-#endif
-                       )
+static int
+persistent_available_p (const char *host, unsigned short port, int ssl)
 {
+#else
+static int
+persistent_available_p (const char *host, unsigned short port)
+{
+#endif
   int success;
   struct address_list *this_host_ip;
 
index b358936a7d8e11d9814193f13d8612741e490ee4..9535472c469dabdafe373ad946e27c615fa11b20 100644 (file)
@@ -235,7 +235,8 @@ maybe_add_to_list (acc_t **newentry, acc_t **list)
    null-terminated string once character to the left.
    Used in processing \ and " constructs in the netrc file */
 static void
-shift_left(char *string){
+shift_left(char *string)
+{
   char *p;
   
   for (p=string; *p; ++p)
index fe6727da48cc8f5c3e6e44fae3e2a6a170a8728e..de5d16a31cda85ae036ca51a362b2fa57be83ed6 100644 (file)
@@ -41,10 +41,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 struct progress_implementation {
   char *name;
-  void *(*create) (long, long);
-  void (*update) (void *, long, long);
-  void (*finish) (void *, long);
-  void (*set_params) (const char *);
+  void *(*create) PARAMS ((long, long));
+  void (*update) PARAMS ((void *, long, long));
+  void (*finish) PARAMS ((void *, long));
+  void (*set_params) PARAMS ((const char *));
 };
 
 /* Necessary forward declarations. */