• Alan Coopersmith's avatar
    Fix implicit conversion warnings in _XlcCreateDefaultCharSet · 30656fd6
    Alan Coopersmith authored
    lcCharSet.c:187:50: warning: implicit conversion changes signedness:
          'int' to 'unsigned long' [-Wsign-conversion]
        tmp = Xmalloc(name_len + 1 + ct_sequence_len + 1);
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
    ../../include/X11/Xlibint.h:453:32: note: expanded from macro 'Xmalloc'
                           ~~~~~~  ^~~~
    lcCharSet.c:192:31: warning: implicit conversion changes signedness:
          'int' to 'unsigned long' [-Wsign-conversion]
        memcpy(tmp, name, name_len+1);
        ~~~~~~            ~~~~~~~~^~
    lcCharSet.c:216:45: warning: implicit conversion changes signedness:
          'int' to 'unsigned long' [-Wsign-conversion]
        memcpy(tmp, ct_sequence, ct_sequence_len+1);
        ~~~~~~                   ~~~~~~~~~~~~~~~^~
    lcCharSet.c:183:16: warning: implicit conversion loses integer precision:
          'unsigned long' to 'int' [-Wshorten-64-to-32]
        name_len = strlen(name);
                 ~ ^~~~~~~~~~~~
    lcCharSet.c:184:23: warning: implicit conversion loses integer precision:
          'unsigned long' to 'int' [-Wshorten-64-to-32]
        ct_sequence_len = strlen(ct_sequence);
                        ~ ^~~~~~~~~~~~~~~~~~~
    lcCharSet.c:198:37: warning: implicit conversion loses integer precision:
         'long' to 'unsigned int' [-Wshorten-64-to-32]
            unsigned int length = colon - charset->name;
                         ~~~~~~   ~~~~~~^~~~~~~~~~~~~~~
    Signed-off-by: Alan Coopersmith's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
    30656fd6
lcCharSet.c 6.55 KB