Search code examples
cdebuggingtypedefunsigned

What is "uns" in C?


I came across this C library: http://www.ucw.cz/libucw/
It contains a sorting routine: http://www.ucw.cz/libucw/doc/sort.html
In array_simple.h there this function declaration:

static void ASORT_PREFIX(sort)(ASORT_ARRAY_ARG uns array_size ASORT_EXTRA_ARGS)

and further in the code:

struct stk { int l, r; } stack[8*sizeof(uns)];
uns sp = 0;

There is no more #includes in that file and no mention about "uns". Needless to say neither VC2010 nor GCC (mingw32) understand what uns is. Help !


Solution

  • typedef unsigned int uns;
    

    http://www.ucw.cz/libucw/doc/def_index.html

    It is in ucw/config.h, which is automatically included by ucw/lib.h.

    (I wonder why they didn't choose uint for an alias instead. Although, some systems already have it as this exact type definition.)