[Groonga-commit] groonga/groonga at ba4f11d [master] clang: suppress warnings

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jun 11 14:29:21 JST 2013


Kouhei Sutou	2013-06-11 14:29:21 +0900 (Tue, 11 Jun 2013)

  New Revision: ba4f11ded2e32f12b2cc94218a3f96e122cc5950
  https://github.com/groonga/groonga/commit/ba4f11ded2e32f12b2cc94218a3f96e122cc5950

  Message:
    clang: suppress warnings
    
    Cast to "char *" explicitly.
    
        lib/hash.c:1321:16: warning: returning
              'uint8_t [4]' from a function with result type 'char *' converts between
              pointers to integer types with different sign [-Wpointer-sign]
                return entry->io_entry.key.buf;
                       ^~~~~~~~~~~~~~~~~~~~~~~
        lib/hash.c:1327:16: warning: returning
              'uint8_t [8]' from a function with result type 'char *' converts between
              pointers to integer types with different sign [-Wpointer-sign]
                return entry->tiny_entry.key.buf;
                       ^~~~~~~~~~~~~~~~~~~~~~~~~
        lib/hash.c:1334:14: warning: returning
              'uint8_t [4]' from a function with result type 'char *' converts between
              pointers to integer types with different sign [-Wpointer-sign]
              return entry->plain_entry.key;
                     ^~~~~~~~~~~~~~~~~~~~~~
        lib/hash.c:1336:14: warning: returning
              'uint8_t [1]' from a function with result type 'char *' converts between
              pointers to integer types with different sign [-Wpointer-sign]
              return entry->rich_entry.key_and_value;
                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Modified files:
    lib/hash.c

  Modified: lib/hash.c (+4 -4)
===================================================================
--- lib/hash.c    2013-06-11 14:07:21 +0900 (ee29e0d)
+++ lib/hash.c    2013-06-11 14:29:21 +0900 (013c252)
@@ -1318,22 +1318,22 @@ grn_hash_entry_get_key(grn_ctx *ctx, grn_hash *hash, grn_hash_entry *entry)
   if (hash->obj.header.flags & GRN_OBJ_KEY_VAR_SIZE) {
     if (grn_hash_is_io_hash(hash)) {
       if (entry->io_entry.flag & HASH_IMMEDIATE) {
-        return entry->io_entry.key.buf;
+        return (char *)entry->io_entry.key.buf;
       } else {
         return (char *)grn_io_hash_key_at(ctx, hash, entry->io_entry.key.offset);
       }
     } else {
       if (entry->tiny_entry.flag & HASH_IMMEDIATE) {
-        return entry->tiny_entry.key.buf;
+        return (char *)entry->tiny_entry.key.buf;
       } else {
         return entry->tiny_entry.key.ptr;
       }
     }
   } else {
     if (hash->key_size == sizeof(uint32_t)) {
-      return entry->plain_entry.key;
+      return (char *)entry->plain_entry.key;
     } else {
-      return entry->rich_entry.key_and_value;
+      return (char *)entry->rich_entry.key_and_value;
     }
   }
 }
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index