0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-07-24 10:25:42 -04:00

nasmlib: Fix space/tabs mess

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2018-12-15 16:40:06 +03:00
parent 3f11ddab41
commit dd83b26e57

View File

@ -96,12 +96,12 @@ static inline size_t nasm_aprintf_size(void)
* loses any "const" part of the argument, although hopefully the * loses any "const" part of the argument, although hopefully the
* compiler will warn in that case. * compiler will warn in that case.
*/ */
#define nasm_delete(p) \ #define nasm_delete(p) \
do { \ do { \
void **_pp = (void **)&(p); \ void **_pp = (void **)&(p); \
nasm_assert_pointer(p); \ nasm_assert_pointer(p); \
nasm_free(*_pp); \ nasm_free(*_pp); \
*_pp = NULL; \ *_pp = NULL; \
} while (0) } while (0)
#define nasm_zero(x) (memset(&(x), 0, sizeof(x))) #define nasm_zero(x) (memset(&(x), 0, sizeof(x)))
#define nasm_zeron(p,n) (memset((p), 0, (n)*sizeof(*(p)))) #define nasm_zeron(p,n) (memset((p), 0, (n)*sizeof(*(p))))
@ -119,17 +119,17 @@ void nasm_write(const void *, size_t, FILE *);
#ifdef static_assert #ifdef static_assert
# define nasm_static_assert(x) static_assert((x), #x) # define nasm_static_assert(x) static_assert((x), #x)
#elif defined(HAVE_FUNC_ATTRIBUTE_ERROR) && defined(__OPTIMIZE__) #elif defined(HAVE_FUNC_ATTRIBUTE_ERROR) && defined(__OPTIMIZE__)
# define nasm_static_assert(x) \ # define nasm_static_assert(x) \
do { \ do { \
if (!(x)) { \ if (!(x)) { \
extern void __attribute__((error("assertion " #x " failed"))) \ extern void __attribute__((error("assertion " #x " failed"))) \
_nasm_static_fail(void); \ _nasm_static_fail(void); \
_nasm_static_fail(); \ _nasm_static_fail(); \
} \ } \
} while (0) } while (0)
#else #else
/* See http://www.drdobbs.com/compile-time-assertions/184401873 */ /* See http://www.drdobbs.com/compile-time-assertions/184401873 */
# define nasm_static_assert(x) \ # define nasm_static_assert(x) \
do { enum { _static_assert_failed = 1/(!!(x)) }; } while (0) do { enum { _static_assert_failed = 1/(!!(x)) }; } while (0)
#endif #endif
@ -139,20 +139,20 @@ void nasm_write(const void *, size_t, FILE *);
* pedantic warnings on gcc, turn them off explicitly around this code. * pedantic warnings on gcc, turn them off explicitly around this code.
*/ */
#ifdef static_assert #ifdef static_assert
# define nasm_try_static_assert(x) \ # define nasm_try_static_assert(x) \
do { \ do { \
not_pedantic_start \ not_pedantic_start \
static_assert(if_constant(x, true), #x); \ static_assert(if_constant(x, true), #x); \
not_pedantic_end \ not_pedantic_end \
} while (0) } while (0)
#elif defined(HAVE_FUNC_ATTRIBUTE_ERROR) && defined(__OPTIMIZE__) #elif defined(HAVE_FUNC_ATTRIBUTE_ERROR) && defined(__OPTIMIZE__)
# define nasm_try_static_assert(x) \ # define nasm_try_static_assert(x) \
do { \ do { \
if (!if_constant(x, true)) { \ if (!if_constant(x, true)) { \
extern void __attribute__((error("assertion " #x " failed"))) \ extern void __attribute__((error("assertion " #x " failed"))) \
_nasm_static_fail(void); \ _nasm_static_fail(void); \
_nasm_static_fail(); \ _nasm_static_fail(); \
} \ } \
} while (0) } while (0)
#else #else
# define nasm_try_static_assert(x) ((void)0) # define nasm_try_static_assert(x) ((void)0)
@ -271,7 +271,7 @@ const char *filename_set_extension(const char *inname, const char *extension);
/* /*
* Power of 2 align helpers * Power of 2 align helpers
*/ */
#undef ALIGN_MASK /* Some BSD flavors define these in system headers */ #undef ALIGN_MASK /* Some BSD flavors define these in system headers */
#undef ALIGN #undef ALIGN
#define ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask)) #define ALIGN_MASK(v, mask) (((v) + (mask)) & ~(mask))
#define ALIGN(v, a) ALIGN_MASK(v, (a) - 1) #define ALIGN(v, a) ALIGN_MASK(v, (a) - 1)
@ -327,8 +327,8 @@ const char * pure_func prefix_name(int);
* Wrappers around fopen()... for future change to a dedicated structure * Wrappers around fopen()... for future change to a dedicated structure
*/ */
enum file_flags { enum file_flags {
NF_BINARY = 0x00000000, /* Binary file (default) */ NF_BINARY = 0x00000000, /* Binary file (default) */
NF_TEXT = 0x00000001, /* Text file */ NF_TEXT = 0x00000001, /* Text file */
NF_NONFATAL = 0x00000000, /* Don't die on open failure (default) */ NF_NONFATAL = 0x00000000, /* Don't die on open failure (default) */
NF_FATAL = 0x00000002, /* Die on open failure */ NF_FATAL = 0x00000002, /* Die on open failure */
NF_FORMAP = 0x00000004 /* Intended to use nasm_map_file() */ NF_FORMAP = 0x00000004 /* Intended to use nasm_map_file() */