tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/common jk_map.c
Date Tue, 07 Dec 2004 13:46:56 GMT
mturk       2004/12/07 05:46:56

  Modified:    jk/native/apache-1.3 mod_jk.c
               jk/native/apache-2.0 mod_jk.c
               jk/native/common jk_map.c
  Log:
  Remove the need for supplying the pointer to old value for jk_map_put
  
  Revision  Changes    Path
  1.57      +5 -8      jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- mod_jk.c	4 Dec 2004 12:13:59 -0000	1.56
  +++ mod_jk.c	7 Dec 2004 13:46:55 -0000	1.57
  @@ -671,7 +671,6 @@
       jk_server_conf_t *conf =
           (jk_server_conf_t *) ap_get_module_config(s->module_config,
                                                     &jk_module);
  -    char *old;
       const char *c, *w;
   
       if (worker != NULL && cmd->path == NULL ) {
  @@ -695,7 +694,7 @@
       /*
        * Add the new worker to the alias map.
        */
  -    jk_map_put(conf->uri_to_context, c, w, (void **)&old);
  +    jk_map_put(conf->uri_to_context, c, w, NULL);
       return NULL;
   }
   
  @@ -714,7 +713,7 @@
       jk_server_conf_t *conf =
           (jk_server_conf_t *) ap_get_module_config(s->module_config,
                                                     &jk_module);
  -    char *old , *uri;
  +    char *uri;
       const char *c, *w;
   
       if (worker != NULL && cmd->path == NULL ) {
  @@ -737,7 +736,7 @@
       /*
        * Add the new worker to the alias map.
        */
  -    jk_map_put(conf->uri_to_context, uri, w, (void **)&old);
  +    jk_map_put(conf->uri_to_context, uri, w, NULL);
       return NULL;
   }
   
  @@ -759,8 +758,7 @@
       /*
        * Add the new automount to the auto map.
        */
  -    char *old;
  -    jk_map_put(conf->automount, worker, virtualhost, (void **)&old);
  +    jk_map_put(conf->automount, worker, virtualhost, NULL);
       return NULL;
   }
   
  @@ -1764,12 +1762,11 @@
       int sz = jk_map_size(src);
       int i;
       for (i = 0; i < sz; i++) {
  -        void *old;
           char *name = jk_map_name_at(src, i);
           if (jk_map_get(src, name, NULL) == NULL) {
               if (!jk_map_put (dst, name,
                    ap_pstrdup(p, jk_map_get_string(src, name, NULL)),
  -                            &old)) {
  +                            NULL)) {
                   jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
               }
           }
  
  
  
  1.107     +5 -8      jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
  
  Index: mod_jk.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- mod_jk.c	4 Dec 2004 12:11:58 -0000	1.106
  +++ mod_jk.c	7 Dec 2004 13:46:55 -0000	1.107
  @@ -715,7 +715,6 @@
       jk_server_conf_t *conf =
           (jk_server_conf_t *) ap_get_module_config(s->module_config,
                                                     &jk_module);
  -    char *old;
       const char *c, *w;
   
       if (worker != NULL && cmd->path == NULL ) {
  @@ -739,7 +738,7 @@
       /*
        * Add the new worker to the alias map.
        */
  -    jk_map_put(conf->uri_to_context, c, w, (void **)&old);
  +    jk_map_put(conf->uri_to_context, c, w, NULL);
       return NULL;
   }
   
  @@ -758,7 +757,7 @@
       jk_server_conf_t *conf =
           (jk_server_conf_t *) ap_get_module_config(s->module_config,
                                                     &jk_module);
  -    char *old , *uri;
  +    char *uri;
       const char *c, *w;
   
       if (worker != NULL && cmd->path == NULL ) {
  @@ -783,7 +782,7 @@
       /*
        * Add the new worker to the alias map.
        */
  -    jk_map_put(conf->uri_to_context, uri, w, (void **)&old);
  +    jk_map_put(conf->uri_to_context, uri, w, NULL);
       return NULL;
   }
   
  @@ -807,8 +806,7 @@
       /*
        * Add the new automount to the auto map.
        */
  -    char *old;
  -    jk_map_put(conf->automount, worker, virtualhost, (void **)&old);
  +    jk_map_put(conf->automount, worker, virtualhost, NULL);
       return NULL;
   }
   
  @@ -1978,12 +1976,11 @@
       int sz = jk_map_size(src);
       int i;
       for (i = 0; i < sz; i++) {
  -        void *old;
           char *name = jk_map_name_at(src, i);
           if (jk_map_get(src, name, NULL) == NULL) {
               if (!jk_map_put(dst, name,
                               apr_pstrdup(p, jk_map_get_string(src, name, NULL)),
  -                            &old)) {
  +                            NULL)) {
                   jk_error_exit(APLOG_MARK, APLOG_EMERG, s, p, "Memory error");
               }
           }
  
  
  
  1.23      +4 -4      jakarta-tomcat-connectors/jk/native/common/jk_map.c
  
  Index: jk_map.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_map.c,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- jk_map.c	29 Nov 2004 16:04:54 -0000	1.22
  +++ jk_map.c	7 Dec 2004 13:46:56 -0000	1.23
  @@ -303,7 +303,8 @@
           }
   
           if (i < m->size) {
  -            *old = (void *)m->values[i];        /* DIRTY */
  +            if (old)
  +                *old = (void *)m->values[i];        /* DIRTY */
               m->values[i] = value;
               rc = JK_TRUE;
           }
  @@ -362,8 +363,7 @@
                       v = jk_pool_strdup(&m->p, v);
                   }
                   if (v) {
  -                    void *old = NULL;
  -                    jk_map_put(m, prp, v, &old);
  +                    jk_map_put(m, prp, v, NULL);
                   }
                   else {
                       rc = JK_FALSE;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message