Changes in boot/generic/src/str.c [4872160:8e893ae] in mainline


Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/generic/src/str.c

    r4872160 r8e893ae  
    100100#include <str.h>
    101101#include <errno.h>
     102
     103/** Check the condition if wchar_t is signed */
     104#ifdef WCHAR_IS_UNSIGNED
     105        #define WCHAR_SIGNED_CHECK(cond)  (true)
     106#else
     107        #define WCHAR_SIGNED_CHECK(cond)  (cond)
     108#endif
    102109
    103110/** Byte mask consisting of lowest @n bits (out of 8) */
     
    198205 *         code was invalid.
    199206 */
    200 int chr_encode(wchar_t ch, char *str, size_t *offset, size_t size)
     207int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t size)
    201208{
    202209        if (*offset >= size)
     
    325332bool ascii_check(wchar_t ch)
    326333{
    327         if ((ch >= 0) && (ch <= 127))
     334        if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 127))
    328335                return true;
    329336       
     
    338345bool chr_check(wchar_t ch)
    339346{
    340         if ((ch >= 0) && (ch <= 1114111))
     347        if (WCHAR_SIGNED_CHECK(ch >= 0) && (ch <= 1114111))
    341348                return true;
    342349       
Note: See TracChangeset for help on using the changeset viewer.