]> sjero.net Git - wget/commitdiff
[svn] Use bitfields for booleans in struct cookie to save space.
authorhniksic <devnull@localhost>
Wed, 22 Jun 2005 01:45:08 +0000 (18:45 -0700)
committerhniksic <devnull@localhost>
Wed, 22 Jun 2005 01:45:08 +0000 (18:45 -0700)
src/ChangeLog
src/cookies.c

index 995a9a467c6de7cffde72aec85e9b73c813807d7..f6a844f612b4611c2f018a3cf6076eb5157e6c2c 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
+
+       * cookies.c (struct cookie): Use 1-bit bitfields for booleans
+       which makes the structure takes less space at no cost in
+       complexity.
+
 2005-06-22  Hrvoje Niksic  <hniksic@xemacs.org>
 
        * Makefile.in ($(OBJ)): Add the config.h dependency.
index 0b690c66b7a4fa119d0b3432499389af8cbeee45..2addd18548c7821e8d9c5139cf0e16527f26f822 100644 (file)
@@ -98,21 +98,21 @@ struct cookie {
   int port;                    /* port number */
   char *path;                  /* path prefix of the cookie */
 
-  int secure;                  /* whether cookie should be
+  unsigned discard_requested :1; /* whether cookie was created to
+                                  request discarding another
+                                  cookie. */
+
+  unsigned secure :1;          /* whether cookie should be
                                   transmitted over non-https
                                   connections. */
-  int domain_exact;            /* whether DOMAIN must match as a
+  unsigned domain_exact :1;    /* whether DOMAIN must match as a
                                   whole. */
 
-  int permanent;               /* whether the cookie should outlive
+  int permanent :1;            /* whether the cookie should outlive
                                   the session. */
   time_t expiry_time;          /* time when the cookie expires, 0
                                   means undetermined. */
 
-  int discard_requested;       /* whether cookie was created to
-                                  request discarding another
-                                  cookie. */
-
   char *attr;                  /* cookie attribute name */
   char *value;                 /* cookie attribute value */