List:Commits« Previous MessageNext Message »
From:Chuck Bell Date:May 18 2009 7:37pm
Subject:bzr commit into mysql-6.0-backup branch (charles.bell:2808) Bug#44608
View as plain text  
#At file:///C:/source/bzr/mysql-6.0-bug-44608/ based on revid:charles.bell@stripped

 2808 Chuck Bell	2009-05-18
      BUG#44608 : Remove C++ comments from C code in backup
      
      The backup code uses C++ comments '// some comment' in its C code 
      modules (*.c). These comments must be change to C-style comments 
      '/* some comment */'. This is needed to help product development 
      build the MySQL code for platforms that have stricter C compiler 
      enforcement (do not have C99 turned on).
      
      This patch changes all C++-style comments to C-style comments
      in the *.c source files for backup.
      modified:
        client/backup_stream.c
        sql/backup/stream_v1.c
        sql/backup/stream_v1.h
        sql/backup/stream_v1_transport.c

per-file messages:
  client/backup_stream.c
    Changed all C++-style comments to C-style comments.
    Changed all doxygen /// or ///< to C-style comments.
  sql/backup/stream_v1.c
    Changed all C++-style comments to C-style comments.
    Changed all doxygen /// or ///< to C-style comments.
  sql/backup/stream_v1.h
    Changed all C++-style comments to C-style comments.
    Changed all doxygen /// or ///< to C-style comments.
  sql/backup/stream_v1_transport.c
    Changed all C++-style comments to C-style comments.
    Changed all doxygen /// or ///< to C-style comments.
=== modified file 'client/backup_stream.c'
--- a/client/backup_stream.c	2009-02-27 09:46:43 +0000
+++ b/client/backup_stream.c	2009-05-18 19:37:27 +0000
@@ -454,14 +454,14 @@ str_open_rd(struct st_stream *strm, cons
   uint16                version;
   const unsigned char   backup_magic_bytes[8]=
     {
-      0xE0, // ###.....
-      0xF8, // #####...
-      0x7F, // .#######
-      0x7E, // .######.
-      0x7E, // .######.
-      0x5F, // .#.#####
-      0x0F, // ....####
-      0x03  // ......##
+      0xE0, /* ###..... */
+      0xF8, /* #####... */
+      0x7F, /* .####### */
+      0x7E, /* .######. */
+      0x7E, /* .######. */
+      0x5F, /* .#.##### */
+      0x0F, /* ....#### */
+      0x03  /* ......## */
     };
 #ifdef HAVE_COMPRESS
   const unsigned char   gzip_magic_bytes[3]=
@@ -1007,7 +1007,7 @@ bcat_add_item(struct st_bstream_image_he
     /* Get a reference to the snapshot information. */
     bup_snapshot= *((struct st_backup_snapshot**)
                     dynamic_array_ptr(&bup_catalog->cat_snapshots, snap_num));
-    DBUG_ASSERT(bup_snapshot); // Never fails, snap_num is checked
+    DBUG_ASSERT(bup_snapshot); /* Never fails, snap_num is checked */
     /*
       Check consistency of array position.
       Table items are not numbered per database, but per snapshot.
@@ -1270,7 +1270,7 @@ bcat_iterator_next(struct st_bstream_ima
   /* Note that the array contains pointers only. */
   item= *((struct st_bstream_item_info**)
           dynamic_array_ptr(iter->it_array, iter->it_index));
-  DBUG_ASSERT(item); // Never fails, iter->it_index is checked
+  DBUG_ASSERT(item); /* Never fails, iter->it_index is checked */
 
   DBUG_PRINT("bupstrm", ("next iterator for type: %u", iter->it_type));
   DBUG_PRINT("bupstrm", ("next item: 0x%lx  pos: %lu  type: %d  name: '%.*s'",
@@ -1807,7 +1807,7 @@ backup_catalog_free(struct st_backup_cat
     /* Note that the array contains pointers only. */
     bup_snapshot= *((struct st_backup_snapshot**)
                     dynamic_array_ptr(&bup_catalog->cat_snapshots, idx));
-    DBUG_ASSERT(bup_snapshot); // Never fails, idx is in range
+    DBUG_ASSERT(bup_snapshot); /* Never fails, idx is in range */
     /* The referenced items are freed with their databases. */
     delete_dynamic(&bup_snapshot->snap_index_pos_to_table);
     /* Free the item itself. */
@@ -1839,7 +1839,7 @@ backup_catalog_free(struct st_backup_cat
       /* Note that the array contains pointers only. */
       bup_perdb= *((struct st_backup_perdb**)
                    dynamic_array_ptr(&bup_database->db_perdbs, jdx));
-      DBUG_ASSERT(bup_perdb); // Never fails, jdx is in range
+      DBUG_ASSERT(bup_perdb); /* Never fails, jdx is in range */
       mdata= &bup_perdb->perdb_metadata;
       my_free(mdata->md_data.begin, MYF(MY_ALLOW_ZERO_PTR));
       my_free(mdata->md_query.begin, MYF(MY_ALLOW_ZERO_PTR));
@@ -1858,7 +1858,7 @@ backup_catalog_free(struct st_backup_cat
       /* Note that the array contains pointers only. */
       bup_table= *((struct st_backup_table**)
                    dynamic_array_ptr(&bup_database->db_tables, jdx));
-      DBUG_ASSERT(bup_table); // Never fails, jdx is in range
+      DBUG_ASSERT(bup_table); /* Never fails, jdx is in range */
       mdata= &bup_table->tbl_metadata;
       my_free(mdata->md_data.begin, MYF(MY_ALLOW_ZERO_PTR));
       my_free(mdata->md_query.begin, MYF(MY_ALLOW_ZERO_PTR));
@@ -1902,7 +1902,7 @@ backup_catalog_free(struct st_backup_cat
         */
         bup_global= *((struct st_backup_global**)
                       dynamic_array_ptr(*init_array_p, idx));
-        DBUG_ASSERT(bup_global); // Never fails, idx is in range
+        DBUG_ASSERT(bup_global); /* Never fails, idx is in range */
 
         DBUG_PRINT("bupstrm", ("freeing meta data."));
         mdata= &bup_global->glb_metadata;

=== modified file 'sql/backup/stream_v1.c'
--- a/sql/backup/stream_v1.c	2009-03-10 18:19:41 +0000
+++ b/sql/backup/stream_v1.c	2009-05-18 19:37:27 +0000
@@ -19,7 +19,7 @@
 # define ASSERT(X)
 #else
 # include <assert.h>
-/// Macro to map assertion call when debug is off.
+/** Macro to map assertion call when debug is off. */
 # define ASSERT(X) assert(X)
 #endif
 
@@ -33,12 +33,12 @@
 
 /* local types */
 
-typedef unsigned char bool; ///< definition of bool
-#define TRUE    1  ///< definition of true
-#define FALSE   0  ///< definition of false
+typedef unsigned char bool; /**< definition of bool */
+#define TRUE    1  /**< definition of true */
+#define FALSE   0  /**< definition of false */
 
-typedef bstream_byte byte;  ///< type definition of bstream byte
-typedef bstream_blob blob;  ///< type definition of bstream blob
+typedef bstream_byte byte;  /**< type definition of bstream byte */
+typedef bstream_blob blob;  /**< type definition of bstream blob */
 
 /**
   Macro mapping bzro() to memset().
@@ -55,20 +55,20 @@ typedef bstream_blob blob;  ///< type de
   error.
 */
 
-/// Macro to check write result.
+/** Macro to check write result. */
 #define CHECK_WR_RES(X) \
   do{\
    if ((ret= X) != BSTREAM_OK) goto wr_error;\
   } while(0)
 
-/// Macro to check read ok return.
+/** Macro to check read ok return. */
 #define CHECK_RD_OK(X) \
  do{\
    if ((ret= X) != BSTREAM_OK)\
     { ret=BSTREAM_ERROR; goto rd_error; }\
  } while(0)
 
-/// Macro to check read result.
+/** Macro to check read result. */
 #define CHECK_RD_RES(X) \
  do{\
    if ((ret= X) == BSTREAM_ERROR) goto rd_error;\
@@ -623,7 +623,7 @@ int bstream_rd_image_info(backup_stream 
   @endverbatim
 */
 
-/// Definition of extra data flag bits.
+/** Definition of extra data flag bits. */
 #define BSTREAM_FLAG_HAS_EXTRA_DATA   0x80
 
 int bstream_wr_db_catalogue(backup_stream*, struct st_bstream_image_header*,
@@ -732,7 +732,7 @@ int bstream_wr_catalogue(backup_stream *
 
   wr_error:
 
-  // Free iterator if not already done
+  /* Free iterator if not already done */
   if (it)
     bcat_iterator_free(cat,it);
 
@@ -888,7 +888,7 @@ int bstream_rd_catalogue(backup_stream *
 
   rd_error:
 
-  // Free iterator if not already done
+  /* Free iterator if not already done */
   if (iter)
     bcat_iterator_free(cat,iter);
 
@@ -1060,7 +1060,7 @@ int bstream_wr_db_catalogue(backup_strea
 
   wr_error:
 
-  // Free iterator if not already done
+  /* Free iterator if not already done */
   if (iter)
     bcat_iterator_free(cat,iter);
 
@@ -1332,7 +1332,7 @@ int bstream_wr_meta_data(backup_stream *
 
 wr_error:
 
-  // Free iterators if not already done
+  /* Free iterators if not already done */
   if (titer)
     bcat_iterator_free(cat,titer);
 
@@ -1414,7 +1414,7 @@ int bstream_rd_meta_data(backup_stream *
 
   rd_error:
 
-  // Free iterator if not already done
+  /* Free iterator if not already done */
   if (iter) 
     bcat_iterator_free(cat,iter);
 
@@ -1461,7 +1461,7 @@ int bstream_rd_meta_data(backup_stream *
   @endverbatim
 */
 
-/// Definition of create statement flag bits.
+/** Definition of create statement flag bits. */
 #define BSTREAM_FLAG_HAS_CREATE_STMT 0x40
 
 /**

=== modified file 'sql/backup/stream_v1.h'
--- a/sql/backup/stream_v1.h	2008-12-18 21:46:36 +0000
+++ b/sql/backup/stream_v1.h	2009-05-18 19:37:27 +0000
@@ -17,7 +17,7 @@
  *
  *********************************************************************/
 
-/// Definition for backup stream byte type.
+/** Definition for backup stream byte type. */
 typedef unsigned char bstream_byte;
 
 /**
@@ -35,7 +35,7 @@ struct st_blob
   bstream_byte *end;   /**< one byte after the last byte of the blob */
 };
 
-/// Definition for backup stream blob structure.
+/** Definition for backup stream blob structure. */
 typedef struct st_blob bstream_blob;
 
 /**
@@ -54,7 +54,7 @@ struct st_bstream_time
   unsigned int        year;  /**< years since 1900 */
 };
 
-/// Definition for backup stream time structure.
+/** Definition for backup stream time structure. */
 typedef struct st_bstream_time bstream_time_t;
 
 /**
@@ -69,8 +69,8 @@ struct st_bstream_binlog_pos
   unsigned long int pos;    /**< position (offset) within the file */
 };
 
-/// Definition for backup stream structure.
-/// @note The struct st_backup_stream is defined below.
+/** Definition for backup stream structure. */
+/** @note The struct st_backup_stream is defined below. */
 typedef struct st_backup_stream backup_stream;
 
 /** Codes returned by backup stream functions */
@@ -98,10 +98,10 @@ enum enum_bstream_ret_codes {
 */
 struct st_server_version
 {
-  unsigned short int  major;   ///< major level
-  unsigned short int  minor;   ///< minor level
-  unsigned short int  release; ///< release level
-  bstream_blob        extra;   ///< extra data about the server
+  unsigned short int  major;   /**< major level */
+  unsigned short int  minor;   /**< minor level */
+  unsigned short int  release; /**< release level */
+  bstream_blob        extra;   /**< extra data about the server */
 };
 
 /**
@@ -250,7 +250,7 @@ struct st_bstream_item_info
 */
 struct st_bstream_ts_info
 {
-  struct st_bstream_item_info  base;  ///< The base of the info class.
+  struct st_bstream_item_info  base;  /**< The base of the info class. */
 };
 
 /**
@@ -260,7 +260,7 @@ struct st_bstream_ts_info
 */
 struct st_bstream_db_info
 {
-  struct st_bstream_item_info  base;  ///< The base of the info class.
+  struct st_bstream_item_info  base;  /**< The base of the info class. */
 };
 
 
@@ -301,11 +301,11 @@ struct st_bstream_titem_info
   inside enum_bstream_item_type but defined separately.
 */
 
-/// Definition of backup stream global item index.
+/** Definition of backup stream global item index. */
 #define BSTREAM_IT_GLOBAL    BSTREAM_IT_LAST
-/// Definition of backup stream per database item index.
+/** Definition of backup stream per database item index. */
 #define BSTREAM_IT_PERDB     (BSTREAM_IT_LAST+1)
-/// Definition of backup stream per table item index.
+/** Definition of backup stream per table item index. */
 #define BSTREAM_IT_PERTABLE  (BSTREAM_IT_LAST+2)
 
 
@@ -407,11 +407,11 @@ int bstream_next_chunk(backup_stream*);
  */
 struct st_abstract_stream
 {
-  /// Pointer to write method.
+  /** Pointer to write method. */
   int (*write)(void*, bstream_blob*, bstream_blob); 
-  /// Pointer to read method.
+  /** Pointer to read method. */
   int (*read)(void*, bstream_blob*, bstream_blob);
-  /// Pointer to forward method.
+  /** Pointer to forward method. */
   int (*forward)(void*, unsigned long int*);
 };
 
@@ -421,10 +421,10 @@ struct st_abstract_stream
 */
 struct st_bstream_buffer
 {
-  bstream_byte  *begin;   ///< pointer to start of stream buffer
-  bstream_byte  *pos;     ///< current position in buffer
-  bstream_byte  *header;  ///< pointer to header
-  bstream_byte  *end;     ///< pointer to end of stream buffer
+  bstream_byte  *begin;   /**< pointer to start of stream buffer */
+  bstream_byte  *pos;     /**< current position in buffer */
+  bstream_byte  *header;  /**< pointer to header */
+  bstream_byte  *end;     /**< pointer to end of stream buffer */
 };
 
 /**
@@ -432,21 +432,21 @@ struct st_bstream_buffer
 */
 struct st_backup_stream
 {
-  struct st_abstract_stream stream; ///< stream metadata
-  unsigned long int block_size;     ///< block size
-  short int init_block_count;       ///< initial block count
-  /// Enumeration for state of the stream
-  enum { CLOSED,         ///< stream has been closed 
-         FIRST_BLOCK,    ///< reading/writing the first block of a stream 
-         NORMAL,         ///< normal operation 
-         LAST_FRAGMENT,  ///< reading last fragment of a chunk 
-         EOS,            ///< end of stream detected 
-         ERROR } state;  ///< state of the stream
-  /// Enumeration for mode of stream (read, write).
-  enum { READING, WRITING } mode; ///< current mode.
-  struct st_bstream_buffer buf; ///< stream buffer
-  bstream_blob mem;             ///< pointer to location in buffer
-  bstream_blob data_buf;        ///< pointer to data buffer
+  struct st_abstract_stream stream; /**< stream metadata */
+  unsigned long int block_size;     /**< block size */
+  short int init_block_count;       /**< initial block count */
+  /** Enumeration for state of the stream */
+  enum { CLOSED,         /**< stream has been closed  */
+         FIRST_BLOCK,    /**< reading/writing the first block of a stream */
+         NORMAL,         /**< normal operation  */
+         LAST_FRAGMENT,  /**< reading last fragment of a chunk */
+         EOS,            /**< end of stream detected */
+         ERROR } state;  /**< state of the stream */
+  /** Enumeration for mode of stream (read, write). */
+  enum { READING, WRITING } mode; /**< current mode. */
+  struct st_bstream_buffer buf; /**< stream buffer */
+  bstream_blob mem;             /**< pointer to location in buffer */
+  bstream_blob data_buf;        /**< pointer to data buffer */
 };
 
 int bstream_open_wr(backup_stream*, unsigned long int, unsigned long int);

=== modified file 'sql/backup/stream_v1_transport.c'
--- a/sql/backup/stream_v1_transport.c	2009-02-09 09:05:20 +0000
+++ b/sql/backup/stream_v1_transport.c	2009-05-18 19:37:27 +0000
@@ -20,7 +20,7 @@
 # define ASSERT(X)
 #else
 # include <assert.h>
-/// Macro to map assertion call when debug is off.
+/** Macro to map assertion call when debug is off. */
 # define ASSERT(X) assert(X)
 #endif
 
@@ -68,12 +68,12 @@
 
 /* Local type definitions. */
 
-#define TRUE    1  ///< definition of true
-#define FALSE   0  ///< definition of false
+#define TRUE    1  /**< definition of true */
+#define FALSE   0  /**< definition of false */
 
-typedef unsigned char bool; ///< Type definition of unsigned character to bool.
-typedef bstream_byte byte;  ///< Type definition of bstream_byte to byte.
-typedef bstream_blob blob;  ///< Type definition of bstream_blob to blob.
+typedef unsigned char bool; /**< Type def of unsigned character to bool. */
+typedef bstream_byte byte;  /**< Type def of bstream_byte to byte. */
+typedef bstream_blob blob;  /**< Type def of bstream_blob to blob. */
 
 /**
   Macro mapping bzro() to memset().
@@ -174,20 +174,20 @@ extern byte get_byte_size_t(size_t value
  *
  *************************************************************************/
 
-#define FR_EOC    0x80  ///< bits for EOC fragment
-#define FR_EOS    0xC0  ///< bits for EOS fragment
-#define FR_MORE   0x00  ///< bits for MORE fragment
-#define FR_LAST   0x40  ///< bits for LAST fragment
+#define FR_EOC    0x80  /**< bits for EOC fragment */
+#define FR_EOS    0xC0  /**< bits for EOS fragment */
+#define FR_MORE   0x00  /**< bits for MORE fragment */
+#define FR_LAST   0x40  /**< bits for LAST fragment */
 
-#define FR_TYPE_MASK  0xC0  ///< type bits for mask
-#define FR_LEN_MASK   (~FR_TYPE_MASK)  ///< type length for mask
+#define FR_TYPE_MASK  0xC0  /**< type bits for mask */
+#define FR_LEN_MASK   (~FR_TYPE_MASK)  /**< type length for mask */
 
 /** biggest size of small fragment */
 #define FR_SMALL_MAX  ((size_t)FR_LEN_MASK)
-#define FR_BIG        0x80        ///< type bits for big fragment
-#define FR_HUGE       0xC0        ///< type bits for huge fragment
-#define FR_BIG_SHIFT  6           ///< value shift for big fragment 
-#define FR_HUGE_SHIFT 12          ///< value shift for huge fragment 
+#define FR_BIG        0x80        /**< type bits for big fragment */
+#define FR_HUGE       0xC0        /**< type bits for huge fragment */
+#define FR_BIG_SHIFT  6           /**< value shift for big fragment */
+#define FR_HUGE_SHIFT 12          /**< value shift for huge fragment */
 /** header for the biggest possible chunk */
 #define FR_HUGE_MAX_HDR (FR_HUGE|FR_LEN_MASK)
 /** size of the biggest possible chunk */
@@ -311,15 +311,15 @@ int read_fragment_header(byte **header)
  (parameter S) to write/read bytes to/from underlying stream.
 */
 
-/// Macro mapping as_write to write method call result.
+/** Macro mapping as_write to write method call result. */
 #define as_write(S,Data,Env) \
   ((S)->write ? (S)->write((S),(Data),(Env)) : BSTREAM_ERROR)
 
-/// Macro mapping as_read to read method call result.
+/** Macro mapping as_read to read method call result. */
 #define as_read(S,Buf,Env) \
   ((S)->read ?(S)->read((S),(Buf),(Env)) : BSTREAM_ERROR)
 
-/// Macro mapping as_forward to forward method call result.
+/** Macro mapping as_forward to forward method call result. */
 #define as_forward(S,Off) \
   ((S)->forward ? (S)->forward((S),(Off)) : (*(Off)=0, BSTREAM_ERROR))
 
@@ -584,7 +584,7 @@ int close_current_fragment(backup_stream
 
  *************************************************************************/
 
-/// Input buffer macro to check validity.
+/** Input buffer macro to check validity. */
 #define IBUF_INV(B) \
   ASSERT((B).begin <= (B).pos); \
   ASSERT((B).begin <= (B).header); \

Thread
bzr commit into mysql-6.0-backup branch (charles.bell:2808) Bug#44608Chuck Bell18 May
  • Re: bzr commit into mysql-6.0-backup branch (charles.bell:2808)Bug#44608Ingo Strüwing19 May