Merge remote branch 'origin/andrei/pointer_alias_warnings'
authorAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 28 Jan 2010 19:19:49 +0000 (20:19 +0100)
committerAndrei Pelinescu-Onciul <andrei@iptel.org>
Thu, 28 Jan 2010 19:19:49 +0000 (20:19 +0100)
compile warning fixes

* origin/andrei/pointer_alias_warnings:
  rr(s): fix recently introduced avp_cookie name bug
  core: avp aliasing warning fixes
  group: fix pointer aliasing warnings
  rr: pointer aliasing warning fixes
  db_postgres: pointer aliasing warnings fixes
  core: pointer aliasing warnings fixed
  cfg: fixed pointer aliasing warnings

Conflicts:
cfg/cfg_ctx.h
route.c

1  2 
cfg/cfg_ctx.c
cfg/cfg_ctx.h
pass_fd.c
route.c
usr_avp.c

diff --cc cfg/cfg_ctx.c
Simple merge
diff --cc cfg/cfg_ctx.h
  #include "cfg.h"
  #include "cfg_struct.h"
  
- /*! \brief linked list of variables with their new values */
+ /* variable values */
+ union cfg_var_value{
+       void* vp;
+       long vlong;
+       int vint;
+       str vstr;
+       unsigned char   vraw[1]; /* variable length */
+ };
 -/* linked list of variables with their new values */
++/** linked list of variables with their new values. */
  typedef struct _cfg_changed_var {
        cfg_group_t     *group;
        cfg_mapping_t   *var;
        struct _cfg_changed_var *next;
  
        /* blob that contains the new value */
-       unsigned char   new_val[1];
+       union cfg_var_value new_val; /* variable size */
  } cfg_changed_var_t;
  
 -/* callback that is called when a new group is declared */
 +/*! \brief callback that is called when a new group is declared */
  typedef void (*cfg_on_declare)(str *, cfg_def_t *);
  
 -/* linked list of registered contexts */
 +/*! \brief linked list of registered contexts */
  typedef struct _cfg_ctx {
        /* variables that are already changed
        but have not been committed yet */
diff --cc pass_fd.c
Simple merge
diff --cc route.c
+++ b/route.c
@@@ -740,8 -727,8 +740,8 @@@ int fix_actions(struct action* a
                                                return E_UNSPEC;
                                        }
                                        */
-                                       if ((ret=fix_rval_expr((void**)&rve))<0)
+                                       if ((ret=fix_rval_expr(&t->val[0].u.data))<0)
 -                                              return ret;
 +                                              goto error;
                                }
                                if ( (t->val[1].type==ACTIONS_ST)&&(t->val[1].u.data) ){
                                        if ((ret=fix_actions((struct action*)t->val[1].u.data))<0)
                                                LOG(L_ERR, "fix_actions: invalid expression (%d,%d):"
                                                                " bad type, integer expected\n",
                                                                rve->fpos.s_line, rve->fpos.s_col);
 -                                              return E_UNSPEC;
 +                                              ret = E_UNSPEC;
 +                                              goto error;
                                        }
-                                       if ((ret=fix_rval_expr((void**)&rve))<0)
+                                       if ((ret=fix_rval_expr(&t->val[0].u.data))<0)
 -                                              return ret;
 +                                              goto error;
                                }else{
                                        LOG(L_CRIT, "BUG: fix_actions: null while()"
                                                        " expression\n");
                                                LOG(L_ERR, "fix_actions: invalid expression (%d,%d):"
                                                                " bad type, integer expected\n",
                                                                rve->fpos.s_line, rve->fpos.s_col);
 -                                              return E_UNSPEC;
 +                                              ret = E_UNSPEC;
 +                                              goto error;
                                        }
-                                       if ((ret=fix_rval_expr((void**)&rve))<0)
+                                       if ((ret=fix_rval_expr(&t->val[0].u.data))<0)
 -                                              return ret;
 +                                              goto error;
                                }else{
                                        LOG(L_CRIT, "BUG: fix_actions: null drop/return"
                                                        " expression\n");
diff --cc usr_avp.c
Simple merge