diff options
author | Peter Johnson <peter@tortall.net> | 2007-04-22 03:32:46 +0000 |
---|---|---|
committer | Peter Johnson <peter@tortall.net> | 2007-04-22 03:32:46 +0000 |
commit | 00473ca98171eb19615109f5a8512993da43a77a (patch) | |
tree | ff659c3a00f05562d7210683c8756303c7d02187 /util.h | |
parent | 4238a7c5ce3b8853ecd1d9cf50eaa354f1038e7d (diff) | |
download | yasm-00473ca98171eb19615109f5a8512993da43a77a.tar.gz |
Bite the bullet and convert tabs to spaces. Previously yasm's source has
been using a mix of tabs and 4 spaces to indent; this looks horrible if
tab size is ever not 8. While I debated converting to tab-only indentation
that would have been a far higher impact to the source.
svn path=/trunk/yasm/; revision=1825
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 78 |
1 files changed, 39 insertions, 39 deletions
@@ -63,7 +63,7 @@ #include <libyasm/coretype.h> #ifdef lint -# define _(String) String +# define _(String) String #else # ifdef HAVE_LOCALE_H # include <locale.h> @@ -71,43 +71,43 @@ # ifdef ENABLE_NLS # include <libintl.h> -# define _(String) gettext(String) +# define _(String) gettext(String) # else -# define gettext(Msgid) (Msgid) -# define dgettext(Domainname, Msgid) (Msgid) +# define gettext(Msgid) (Msgid) +# define dgettext(Domainname, Msgid) (Msgid) # define dcgettext(Domainname, Msgid, Category) (Msgid) -# define textdomain(Domainname) while (0) /* nothing */ -# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ -# define _(String) (String) +# define textdomain(Domainname) while (0) /* nothing */ +# define bindtextdomain(Domainname, Dirname) while (0) /* nothing */ +# define _(String) (String) # endif #endif #ifdef gettext_noop -# define N_(String) gettext_noop(String) +# define N_(String) gettext_noop(String) #else -# define N_(String) (String) +# define N_(String) (String) #endif #ifdef HAVE_MERGESORT -#define yasm__mergesort(a, b, c, d) mergesort(a, b, c, d) +#define yasm__mergesort(a, b, c, d) mergesort(a, b, c, d) #endif #ifdef HAVE_STRSEP -#define yasm__strsep(a, b) strsep(a, b) +#define yasm__strsep(a, b) strsep(a, b) #endif #ifdef HAVE_STRCASECMP -# define yasm__strcasecmp(x, y) strcasecmp(x, y) -# define yasm__strncasecmp(x, y, n) strncasecmp(x, y, n) +# define yasm__strcasecmp(x, y) strcasecmp(x, y) +# define yasm__strncasecmp(x, y, n) strncasecmp(x, y, n) #elif HAVE_STRICMP -# define yasm__strcasecmp(x, y) stricmp(x, y) -# define yasm__strncasecmp(x, y, n) strnicmp(x, y, n) +# define yasm__strcasecmp(x, y) stricmp(x, y) +# define yasm__strncasecmp(x, y, n) strnicmp(x, y, n) #elif HAVE__STRICMP -# define yasm__strcasecmp(x, y) _stricmp(x, y) -# define yasm__strncasecmp(x, y, n) _strnicmp(x, y, n) +# define yasm__strcasecmp(x, y) _stricmp(x, y) +# define yasm__strncasecmp(x, y, n) _strnicmp(x, y, n) #elif HAVE_STRCMPI -# define yasm__strcasecmp(x, y) strcmpi(x, y) -# define yasm__strncasecmp(x, y, n) strncmpi(x, y, n) +# define yasm__strcasecmp(x, y) strcmpi(x, y) +# define yasm__strncasecmp(x, y, n) strncmpi(x, y, n) #else # define USE_OUR_OWN_STRCASECMP #endif @@ -123,37 +123,37 @@ #endif #ifdef __RCSID -# define RCSID(s) __RCSID(s) +# define RCSID(s) __RCSID(s) #elif defined(__GNUC__) && defined(__ELF__) -# define RCSID(s) __asm__(".ident\t\"" s "\"") +# define RCSID(s) __asm__(".ident\t\"" s "\"") #else -# define RCSID(s) static const char rcsid[] = s +# define RCSID(s) static const char rcsid[] = s #endif #ifdef WITH_DMALLOC # include <dmalloc.h> -# define yasm__xstrdup(str) xstrdup(str) -# define yasm_xmalloc(size) xmalloc(size) -# define yasm_xcalloc(count, size) xcalloc(count, size) -# define yasm_xrealloc(ptr, size) xrealloc(ptr, size) -# define yasm_xfree(ptr) xfree(ptr) +# define yasm__xstrdup(str) xstrdup(str) +# define yasm_xmalloc(size) xmalloc(size) +# define yasm_xcalloc(count, size) xcalloc(count, size) +# define yasm_xrealloc(ptr, size) xrealloc(ptr, size) +# define yasm_xfree(ptr) xfree(ptr) #endif /* Bit-counting: used primarily by HAMT but also in a few other places. */ -#define BC_TWO(c) (0x1ul << (c)) -#define BC_MSK(c) (((unsigned long)(-1)) / (BC_TWO(BC_TWO(c)) + 1ul)) -#define BC_COUNT(x,c) ((x) & BC_MSK(c)) + (((x) >> (BC_TWO(c))) & BC_MSK(c)) -#define BitCount(d, s) do { \ - d = BC_COUNT(s, 0); \ - d = BC_COUNT(d, 1); \ - d = BC_COUNT(d, 2); \ - d = BC_COUNT(d, 3); \ - d = BC_COUNT(d, 4); \ +#define BC_TWO(c) (0x1ul << (c)) +#define BC_MSK(c) (((unsigned long)(-1)) / (BC_TWO(BC_TWO(c)) + 1ul)) +#define BC_COUNT(x,c) ((x) & BC_MSK(c)) + (((x) >> (BC_TWO(c))) & BC_MSK(c)) +#define BitCount(d, s) do { \ + d = BC_COUNT(s, 0); \ + d = BC_COUNT(d, 1); \ + d = BC_COUNT(d, 2); \ + d = BC_COUNT(d, 3); \ + d = BC_COUNT(d, 4); \ } while (0) /** Determine if a value is exactly a power of 2. Zero is treated as a power * of two. - * \param x value + * \param x value * \return Nonzero if x is a power of 2. */ #define is_exp2(x) ((x & (x - 1)) == 0) @@ -161,10 +161,10 @@ #ifndef NELEMS /** Get the number of elements in an array. * \internal - * \param array array + * \param array array * \return Number of elements. */ -#define NELEMS(array) (sizeof(array) / sizeof(array[0])) +#define NELEMS(array) (sizeof(array) / sizeof(array[0])) #endif #endif |