List:Commits« Previous MessageNext Message »
From:Davi Arnaut Date:September 24 2010 10:13pm
Subject:bzr commit into mysql-5.1-bugteam branch (davi:3518) Bug#45288
View as plain text  
# At a local mysql-5.1-bugteam repository of davi

 3518 Davi Arnaut	2010-09-24
      Bug#45288: pb2 returns a lot of compilation warnings on linux
      
      Use UNINIT_VAR workaround instead of LINT_INIT. The former can
      also be used to silence false-positives in non-debug builds as
      it actually does not cause new code to be generated.

    modified:
      mysys/my_getopt.c
      storage/myisam/mi_range.c
      storage/myisam/mi_search.c
      storage/myisam/rt_index.c
      storage/myisam/rt_split.c
=== modified file 'mysys/my_getopt.c'
--- a/mysys/my_getopt.c	2010-08-04 12:58:09 +0000
+++ b/mysys/my_getopt.c	2010-09-24 22:13:51 +0000
@@ -112,7 +112,7 @@ int handle_options(int *argc, char ***ar
 		   const struct my_option *longopts,
                    my_get_one_option get_one_option)
 {
-  uint opt_found, argvpos= 0, length;
+  uint UNINIT_VAR(opt_found), argvpos= 0, length;
   my_bool end_of_options= 0, must_be_var, set_maximum_value,
           option_is_loose;
   char **pos, **pos_end, *optend, *opt_str, key_name[FN_REFLEN];
@@ -121,7 +121,6 @@ int handle_options(int *argc, char ***ar
   void *value;
   int error, i;
 
-  LINT_INIT(opt_found);
   /* handle_options() assumes arg0 (program name) always exists */
   DBUG_ASSERT(argc && *argc >= 1);
   DBUG_ASSERT(argv && *argv);

=== modified file 'storage/myisam/mi_range.c'
--- a/storage/myisam/mi_range.c	2007-10-11 15:07:40 +0000
+++ b/storage/myisam/mi_range.c	2010-09-24 22:13:51 +0000
@@ -193,12 +193,11 @@ static double _mi_search_pos(register MI
 			     register my_off_t pos)
 {
   int flag;
-  uint nod_flag,keynr,max_keynr;
+  uint nod_flag,keynr,UNINIT_VAR(max_keynr);
   my_bool after_key;
   uchar *keypos,*buff;
   double offset;
   DBUG_ENTER("_mi_search_pos");
-  LINT_INIT(max_keynr);
 
   if (pos == HA_OFFSET_ERROR)
     DBUG_RETURN(0.5);

=== modified file 'storage/myisam/mi_search.c'
--- a/storage/myisam/mi_search.c	2010-07-02 18:30:47 +0000
+++ b/storage/myisam/mi_search.c	2010-09-24 22:13:51 +0000
@@ -296,9 +296,9 @@ int _mi_prefix_search(MI_INFO *info, reg
     flag is the value returned by ha_key_cmp and as treated as final
   */
   int flag=0, my_flag=-1;
-  uint nod_flag, length, len, matched, cmplen, kseg_len;
-  uint prefix_len,suffix_len;
-  int key_len_skip, seg_len_pack, key_len_left;
+  uint nod_flag, UNINIT_VAR(length), len, matched, cmplen, kseg_len;
+  uint UNINIT_VAR(prefix_len), suffix_len;
+  int key_len_skip, UNINIT_VAR(seg_len_pack), key_len_left;
   uchar *end, *kseg, *vseg;
   uchar *sort_order=keyinfo->seg->charset->sort_order;
   uchar tt_buff[MI_MAX_KEY_BUFF+2], *t_buff=tt_buff+2;
@@ -308,10 +308,6 @@ int _mi_prefix_search(MI_INFO *info, reg
   uint  length_pack;
   DBUG_ENTER("_mi_prefix_search");
 
-  LINT_INIT(length);
-  LINT_INIT(prefix_len);
-  LINT_INIT(seg_len_pack);
-
   t_buff[0]=0;                                  /* Avoid bugs */
   end= page+mi_getint(page);
   nod_flag=mi_test_if_nod(page);

=== modified file 'storage/myisam/rt_index.c'
--- a/storage/myisam/rt_index.c	2010-03-25 11:18:14 +0000
+++ b/storage/myisam/rt_index.c	2010-09-24 22:13:51 +0000
@@ -481,17 +481,13 @@ static uchar *rtree_pick_key(MI_INFO *in
 			     uint key_length, uchar *page_buf, uint nod_flag)
 {
   double increase;
-  double best_incr;
+  double UNINIT_VAR(best_incr);
   double area;
-  double best_area;
+  double UNINIT_VAR(best_area);
   uchar *best_key= NULL;
   uchar *k = rt_PAGE_FIRST_KEY(page_buf, nod_flag);
   uchar *last = rt_PAGE_END(page_buf);
 
-  LINT_INIT(best_area);
-  LINT_INIT(best_key);
-  LINT_INIT(best_incr);
-
   for (; k < last; k = rt_PAGE_NEXT_KEY(k, key_length, nod_flag))
   {
     /* The following is safe as -1.0 is an exact number */

=== modified file 'storage/myisam/rt_split.c'
--- a/storage/myisam/rt_split.c	2010-07-20 18:07:36 +0000
+++ b/storage/myisam/rt_split.c	2010-09-24 22:13:51 +0000
@@ -178,18 +178,13 @@ static int split_rtree_node(SplitStruct
                    double **d_buffer, int n_dim)
 {
   SplitStruct *cur;
-  SplitStruct *a;
-  SplitStruct *b;
+  SplitStruct *UNINIT_VAR(a), *UNINIT_VAR(b);
   double *g1 = reserve_coords(d_buffer, n_dim);
   double *g2 = reserve_coords(d_buffer, n_dim);
-  SplitStruct *next;
-  int next_node;
+  SplitStruct *UNINIT_VAR(next);
+  int UNINIT_VAR(next_node);
   int i;
   SplitStruct *end = node + n_entries;
-  LINT_INIT(a);
-  LINT_INIT(b);
-  LINT_INIT(next);
-  LINT_INIT(next_node);
 
   if (all_size < min_size * 2)
   {


Attachment: [text/bzr-bundle] bzr/davi.arnaut@oracle.com-20100924221351-opnp1j8olm08gxmt.bundle
Thread
bzr commit into mysql-5.1-bugteam branch (davi:3518) Bug#45288Davi Arnaut25 Sep