Mark various header tables and definitions as read-only
authorPanu Matilainen <pmatilai@redhat.com>
Thu, 6 Mar 2008 17:50:41 +0000 (19:50 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 6 Mar 2008 17:50:41 +0000 (19:50 +0200)
rpmdb/header.c
rpmdb/header_internal.c

index ecc24e0..c69717a 100644 (file)
@@ -26,14 +26,14 @@ int _hdr_debug = 0;
 
 /** \ingroup header
  */
-static unsigned char header_magic[8] = {
+static unsigned char const header_magic[8] = {
        0x8e, 0xad, 0xe8, 0x01, 0x00, 0x00, 0x00, 0x00
 };
 
 /** \ingroup header
  * Alignment needed for header data types.
  */
-static int typeAlign[16] =  {
+static const int typeAlign[16] =  {
     1, /*!< RPM_NULL_TYPE */
     1, /*!< RPM_CHAR_TYPE */
     1, /*!< RPM_INT8_TYPE */
@@ -55,7 +55,7 @@ static int typeAlign[16] =  {
 /** \ingroup header
  * Size of header data types.
  */
-static int typeSizes[16] =  { 
+static const int typeSizes[16] =  { 
     0, /*!< RPM_NULL_TYPE */
     1, /*!< RPM_CHAR_TYPE */
     1, /*!< RPM_INT8_TYPE */
@@ -77,7 +77,7 @@ static int typeSizes[16] =  {
 /** \ingroup header
  * Maximum no. of bytes permitted in a header.
  */
-static size_t headerMaxbytes = (32*1024*1024);
+static const size_t headerMaxbytes = (32*1024*1024);
 
 /**
  * Sanity check on no. of tags.
index 2cbb712..b438bdd 100644 (file)
@@ -170,7 +170,7 @@ void headerDump(Header h, FILE *f, int flags,
 
 char * bin2hex(const char *data, size_t size)
 {
-    static char hex[] = "0123456789abcdef";
+    static char const hex[] = "0123456789abcdef";
     const char * s = data;
     char * t, * val;
     val = t = xmalloc(size * 2 + 1);