made more acceptable for ANSI C

This commit is contained in:
ceriel 1991-11-26 14:48:27 +00:00
parent 89887ef6b0
commit f4ecd50601
5 changed files with 15 additions and 15 deletions

View file

@ -8,7 +8,7 @@
public check_mallinks(), calc_checksum(), check_work_empty(); public check_mallinks(), calc_checksum(), check_work_empty();
public started_working_on(), stopped_working_on(); public started_working_on(), stopped_working_on();
#else ifndef CHECK #else /* ifndef CHECK */
#define maldump(n) abort() #define maldump(n) abort()
#define check_mallinks(s) 0 #define check_mallinks(s) 0
@ -17,4 +17,4 @@ public started_working_on(), stopped_working_on();
#define stopped_working_on(ml) 0 #define stopped_working_on(ml) 0
#define check_work_empty(s) 0 #define check_work_empty(s) 0
#endif CHECK #endif /* CHECK */

View file

@ -39,9 +39,9 @@ typedef union _inf mallink;
*/ */
#ifndef NON_STANDARD #ifndef NON_STANDARD
#define OFF_SET 0 #define OFF_SET 0
#else def NON_STANDARD #else /* def NON_STANDARD */
#define OFF_SET 2 #define OFF_SET 2
#endif NON_STANDARD #endif /* NON_STANDARD */
#define _log_prev_of(ml) ((ml)[-1+OFF_SET]).ptr #define _log_prev_of(ml) ((ml)[-1+OFF_SET]).ptr
#define _log_next_of(ml) ((ml)[-2+OFF_SET]).ptr #define _log_next_of(ml) ((ml)[-2+OFF_SET]).ptr
@ -54,7 +54,7 @@ typedef union _inf mallink;
#define _print_of(ml) ((ml)[-6+OFF_SET]).ui #define _print_of(ml) ((ml)[-6+OFF_SET]).ui
#define _mark_of(ml) ((ml)[-7+OFF_SET]).ui #define _mark_of(ml) ((ml)[-7+OFF_SET]).ui
#define N_WORDS 7 #define N_WORDS 7
#endif CHECK #endif /* CHECK */
#define mallink_size() (unsigned int) \ #define mallink_size() (unsigned int) \
align((N_WORDS - OFF_SET) * sizeof (mallink)) align((N_WORDS - OFF_SET) * sizeof (mallink))
@ -65,7 +65,7 @@ typedef union _inf mallink;
#define set_checksum(ml,e) (_checksum_of(ml) = (e)) #define set_checksum(ml,e) (_checksum_of(ml) = (e))
#define checksum_of(ml) (_checksum_of(ml)) #define checksum_of(ml) (_checksum_of(ml))
#endif CHECK #endif /* CHECK */
#define new_mallink(ml) ( _log_prev_of(ml) = 0, \ #define new_mallink(ml) ( _log_prev_of(ml) = 0, \
_log_next_of(ml) = 0, \ _log_next_of(ml) = 0, \
@ -80,14 +80,14 @@ typedef union _inf mallink;
#ifndef EXTERN #ifndef EXTERN
#define private static #define private static
#define privatedata static #define privatedata static
#else def EXTERN #else /* def EXTERN */
#define private extern #define private extern
#define privatedata #define privatedata
#endif EXTERN #endif /* EXTERN */
#ifdef ASSERT #ifdef ASSERT
public m_assert(); public m_assert();
#define assert(b) (!(b) ? m_assert(__FILE__, __LINE__) : 0) #define assert(b) (!(b) ? m_assert(__FILE__, __LINE__) : 0)
#else ndef ASSERT #else /* ndef ASSERT */
#define assert(b) 0 #define assert(b) 0
#endif ASSERT #endif /* ASSERT */

View file

@ -33,9 +33,9 @@ public Error();
(char *)Error("phys_prev_of first_mallink %lx", "somewhere", (long)ml) : \ (char *)Error("phys_prev_of first_mallink %lx", "somewhere", (long)ml) : \
(char *)__phys_prev_of(ml) \ (char *)__phys_prev_of(ml) \
) )
#else ndef CHECK #else /* ndef CHECK */
#define phys_prev_of(ml) __phys_prev_of(ml) #define phys_prev_of(ml) __phys_prev_of(ml)
#endif CHECK #endif /* CHECK */
#define first_mallink(ml) (int) (__phys_prev_of(ml) == 0) #define first_mallink(ml) (int) (__phys_prev_of(ml) == 0)
#define last_mallink(ml) (int) ((ml) == ml_last) #define last_mallink(ml) (int) ((ml) == ml_last)
@ -69,7 +69,7 @@ public Error();
#ifdef CHECK #ifdef CHECK
#define set_print(ml,e) (_print_of(ml) = (e)) #define set_print(ml,e) (_print_of(ml) = (e))
#define print_of(ml) (_print_of(ml)) #define print_of(ml) (_print_of(ml))
#endif CHECK #endif /* CHECK */
public truncate(), combine_chunks(); public truncate(), combine_chunks();
public mallink *create_chunk(); public mallink *create_chunk();

View file

@ -72,4 +72,4 @@ extern unsigned int
EM_lineno; EM_lineno;
extern int extern int
EM_wordsize, EM_pointersize; EM_wordsize, EM_pointersize;
#endif __EMCOMP_INCLUDED__ #endif /* __EMCOMP_INCLUDED__ */

View file

@ -44,4 +44,4 @@ extern File _sys_ftab[];
/* system's idea of block */ /* system's idea of block */
#define BUFSIZ 1024 #define BUFSIZ 1024
#endif __SYSTEM_INCLUDED__ #endif /* __SYSTEM_INCLUDED__ */