Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/tip/tip/tip.h
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* variable manipulation stuff -- | * variable manipulation stuff -- | ||||
* if we defined the value entry in value_t, then we couldn't | * if we defined the value entry in value_t, then we couldn't | ||||
* initialize it in vars.c, so we cast it as needed to keep lint | * initialize it in vars.c, so we cast it as needed to keep lint | ||||
* happy. | * happy. | ||||
*/ | */ | ||||
#define value(v) vtable[v].v_value | #define value(v) vtable[v].v_value | ||||
#define lvalue(v) (long)vtable[v].v_value | #define lvalue(v) (long)(intptr_t)vtable[v].v_value | ||||
#define number(v) ((long)(v)) | #define number(v) ((long)(intptr_t)(v)) | ||||
#define boolean(v) ((short)(long)(v)) | #define boolean(v) ((short)(intptr_t)(v)) | ||||
#define character(v) ((char)(long)(v)) | #define character(v) ((char)(intptr_t)(v)) | ||||
jrtc27: The whitespace here is actually dodgy (number has a tab, but boolean and character have spaces… | |||||
#define address(v) ((long *)(v)) | #define address(v) ((long *)(v)) | ||||
#define setnumber(v,n) do { (v) = (char *)(long)(n); } while (0) | #define setnumber(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) | ||||
#define setboolean(v,n) do { (v) = (char *)(long)(n); } while (0) | #define setboolean(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) | ||||
#define setcharacter(v,n) do { (v) = (char *)(long)(n); } while (0) | #define setcharacter(v,n) do { (v) = (char *)(intptr_t)(n); } while (0) | ||||
#define setaddress(v,n) do { (v) = (char *)(n); } while (0) | #define setaddress(v,n) do { (v) = (char *)(n); } while (0) | ||||
/* | /* | ||||
* Escape command table definitions -- | * Escape command table definitions -- | ||||
* lookup in this table is performed when ``escapec'' is recognized | * lookup in this table is performed when ``escapec'' is recognized | ||||
* at the beginning of a line (as defined by the eolmarks variable). | * at the beginning of a line (as defined by the eolmarks variable). | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 187 Lines • Show Last 20 Lines |
The whitespace here is actually dodgy (number has a tab, but boolean and character have spaces after them). I didn't notice when writing this patch, only the next one, but can update that when committing this if approved.