[gobject-introspection/fix-msvc-warnings: 1/3] brz.c: Avoid C4715 warnings




commit 5c625f647bc4d1e9eaca126f98de9df9ece7804a
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Fri Apr 2 11:42:09 2021 +0800

    brz.c: Avoid C4715 warnings
    
    Later GLib versions assume that warning C4715 is an error as we want ot
    be sure that functions that return a value do indeed return one by all
    means.
    
    Avoid this warning by adding  a 'return 0' in brz_search_packed(), it
    might be pointless but does indeed avoid the warning.

 girepository/cmph/brz.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/girepository/cmph/brz.c b/girepository/cmph/brz.c
index cd35c8d8..2fff05bf 100644
--- a/girepository/cmph/brz.c
+++ b/girepository/cmph/brz.c
@@ -1028,7 +1028,9 @@ cmph_uint32 brz_search_packed(void *packed_mphf, const char *key, cmph_uint32 ke
                        return brz_fch_search_packed(ptr, key, keylen, fingerprint);
                case CMPH_BMZ8:
                        return brz_bmz8_search_packed(ptr, key, keylen, fingerprint);
-               default: assert(0);
+               default:
+                       assert(0);
+                       return 0; /* To avoid warnings that value must be returned */
        }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]