mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-02-17 01:11:45 +00:00
Correct the spelling of "nil".
This commit is contained in:
parent
fb8b3d1211
commit
c38ea0b1bc
29 changed files with 87 additions and 87 deletions
|
@ -221,7 +221,7 @@ integer (integer key, integer unicode, integer down) load_keyevent =
|
||||||
case QFM_BUTTON1:
|
case QFM_BUTTON1:
|
||||||
if (loadable[load_cursor]) {
|
if (loadable[load_cursor]) {
|
||||||
S_LocalSound ("misc/menu2.wav");
|
S_LocalSound ("misc/menu2.wav");
|
||||||
Menu_SelectMenu (NIL);
|
Menu_SelectMenu (nil);
|
||||||
Cbuf_AddText (sprintf ("load s%i.sav\n", load_cursor));
|
Cbuf_AddText (sprintf ("load s%i.sav\n", load_cursor));
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -246,7 +246,7 @@ integer (integer key, integer unicode, integer down) save_keyevent =
|
||||||
return 1;
|
return 1;
|
||||||
case QFK_RETURN:
|
case QFK_RETURN:
|
||||||
case QFM_BUTTON1:
|
case QFM_BUTTON1:
|
||||||
Menu_SelectMenu (NIL);
|
Menu_SelectMenu (nil);
|
||||||
Cbuf_AddText (sprintf ("save s%i.sav\n", save_cursor));
|
Cbuf_AddText (sprintf ("save s%i.sav\n", save_cursor));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ integer (integer key, integer unicode, integer down) quit_keyevent =
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (key == 'n') {
|
if (key == 'n') {
|
||||||
Menu_SelectMenu (NIL);
|
Menu_SelectMenu (nil);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -329,7 +329,7 @@ void () quit_menu =
|
||||||
|
|
||||||
integer (string text, integer key) sp_start =
|
integer (string text, integer key) sp_start =
|
||||||
{
|
{
|
||||||
Menu_SelectMenu (NIL);
|
Menu_SelectMenu (nil);
|
||||||
Cbuf_AddText ("disconnect\n");
|
Cbuf_AddText ("disconnect\n");
|
||||||
Cbuf_AddText ("maxplayers 1\n");
|
Cbuf_AddText ("maxplayers 1\n");
|
||||||
Cbuf_AddText ("coop 0\n");
|
Cbuf_AddText ("coop 0\n");
|
||||||
|
@ -443,7 +443,7 @@ integer (integer key, integer unicode, integer down) lanconfig_keyevent =
|
||||||
break;
|
break;
|
||||||
case QFK_RETURN:
|
case QFK_RETURN:
|
||||||
if (input_active) {
|
if (input_active) {
|
||||||
input_active = NIL;
|
input_active = nil;
|
||||||
} else {
|
} else {
|
||||||
if (lanConfig_cursor == 0) {
|
if (lanConfig_cursor == 0) {
|
||||||
input_active = lanConfig_port_il;
|
input_active = lanConfig_port_il;
|
||||||
|
|
|
@ -186,7 +186,7 @@ get_hash_keys =
|
||||||
}
|
}
|
||||||
if (binding.keys) {
|
if (binding.keys) {
|
||||||
str_free (binding.keys);
|
str_free (binding.keys);
|
||||||
binding.keys = NIL;
|
binding.keys = nil;
|
||||||
}
|
}
|
||||||
if (desc1) {
|
if (desc1) {
|
||||||
binding.keys = str_new ();
|
binding.keys = str_new ();
|
||||||
|
|
|
@ -430,7 +430,7 @@ KEYEV_player_options =
|
||||||
Cvar_SetString (teamname_cvar,
|
Cvar_SetString (teamname_cvar,
|
||||||
[player_config_tname_il text]);
|
[player_config_tname_il text]);
|
||||||
}
|
}
|
||||||
player_config_iactive = NIL;
|
player_config_iactive = nil;
|
||||||
} else {
|
} else {
|
||||||
if (player_config_cursor == 0) {
|
if (player_config_cursor == 0) {
|
||||||
player_config_iactive = player_config_plname_il;
|
player_config_iactive = player_config_plname_il;
|
||||||
|
@ -560,7 +560,7 @@ MENU_player_options =
|
||||||
[player_config_tname_il setWidth:7];
|
[player_config_tname_il setWidth:7];
|
||||||
[player_options addView:player_config_tname_il];
|
[player_options addView:player_config_tname_il];
|
||||||
|
|
||||||
player_config_iactive = NIL;
|
player_config_iactive = nil;
|
||||||
|
|
||||||
rect = makeRect (192, PLAYER_CONF_Y_PAD + 37, 24, 24);
|
rect = makeRect (192, PLAYER_CONF_Y_PAD + 37, 24, 24);
|
||||||
topcolor_view = [[CvarColorView alloc] initWithBounds:rect :[[CvarColor alloc] initWithCvar:"topcolor"]];
|
topcolor_view = [[CvarColorView alloc] initWithBounds:rect :[[CvarColor alloc] initWithCvar:"topcolor"]];
|
||||||
|
@ -626,7 +626,7 @@ KEYEV_network_options =
|
||||||
Cvar_SetString ("rate",
|
Cvar_SetString ("rate",
|
||||||
[network_config_rate_il text]);
|
[network_config_rate_il text]);
|
||||||
}
|
}
|
||||||
network_config_iactive = NIL;
|
network_config_iactive = nil;
|
||||||
} else {
|
} else {
|
||||||
if (network_config_cursor == 0) {
|
if (network_config_cursor == 0) {
|
||||||
network_config_iactive = network_config_rate_il;
|
network_config_iactive = network_config_rate_il;
|
||||||
|
|
|
@ -50,7 +50,7 @@ class_from_plist (PLDictionary []pldict)
|
||||||
class = obj_lookup_class (classname);
|
class = obj_lookup_class (classname);
|
||||||
if (!class) {
|
if (!class) {
|
||||||
dprint ("could not find " + classname + "\n");
|
dprint ("could not find " + classname + "\n");
|
||||||
ret.pointer_val = NIL;
|
ret.pointer_val = nil;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
obj = [class alloc];
|
obj = [class alloc];
|
||||||
|
@ -140,7 +140,7 @@ string_from_plist (PLString []plstring)
|
||||||
if (str_mid (str, 0, 1) == "[")
|
if (str_mid (str, 0, 1) == "[")
|
||||||
return rect_from_plist (plstring);
|
return rect_from_plist (plstring);
|
||||||
|
|
||||||
ret.string_val = NIL;
|
ret.string_val = nil;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ object_from_plist (PLItem []plist)
|
||||||
case QFArray:
|
case QFArray:
|
||||||
return array_from_plist ((PLArray []) plist);
|
return array_from_plist ((PLArray []) plist);
|
||||||
case QFBinary:
|
case QFBinary:
|
||||||
ret.pointer_val = NIL;
|
ret.pointer_val = nil;
|
||||||
return ret;
|
return ret;
|
||||||
case QFString:
|
case QFString:
|
||||||
return string_from_plist ((PLString []) plist);
|
return string_from_plist ((PLString []) plist);
|
||||||
|
@ -171,7 +171,7 @@ read_plist (string fname)
|
||||||
file = QFS_OpenFile (fname);
|
file = QFS_OpenFile (fname);
|
||||||
if (!file) {
|
if (!file) {
|
||||||
dprint ("could not load menu.plist\n");
|
dprint ("could not load menu.plist\n");
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
plist = [PLItem fromFile:file];
|
plist = [PLItem fromFile:file];
|
||||||
Qclose (file);
|
Qclose (file);
|
||||||
|
|
|
@ -24,10 +24,10 @@ integer deathmatch;
|
||||||
local integer i;
|
local integer i;
|
||||||
self = [super init];
|
self = [super init];
|
||||||
|
|
||||||
head = NIL;
|
head = nil;
|
||||||
|
|
||||||
for (i = 0; i < MAX_BODIES; i++) {
|
for (i = 0; i < MAX_BODIES; i++) {
|
||||||
local GameEntity[] ent = NIL;
|
local GameEntity[] ent = nil;
|
||||||
ent = [[GameEntity alloc] init];
|
ent = [[GameEntity alloc] init];
|
||||||
bodies[i] = ent.ent;
|
bodies[i] = ent.ent;
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
ypos = yabs = y;
|
ypos = yabs = y;
|
||||||
xlen = w;
|
xlen = w;
|
||||||
ylen = h;
|
ylen = h;
|
||||||
parent = NIL;
|
parent = nil;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@
|
||||||
- (id) initWithCapacity: (unsigned)cap
|
- (id) initWithCapacity: (unsigned)cap
|
||||||
{
|
{
|
||||||
if (!(self = [super init]))
|
if (!(self = [super init]))
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
if ((capacity = cap) < 1)
|
if ((capacity = cap) < 1)
|
||||||
|
@ -93,7 +93,7 @@
|
||||||
local unsigned max = [array count];
|
local unsigned max = [array count];
|
||||||
|
|
||||||
if (!(self = [self initWithCapacity: max]))
|
if (!(self = [self initWithCapacity: max]))
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
for (i = 0; i < max; i++) {
|
for (i = 0; i < max; i++) {
|
||||||
_objs[i] = [[array objectAtIndex: i] retain];
|
_objs[i] = [[array objectAtIndex: i] retain];
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
local unsigned max = [array count];
|
local unsigned max = [array count];
|
||||||
|
|
||||||
if (!(self = [self initWithCapacity: max]))
|
if (!(self = [self initWithCapacity: max]))
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
for (i = 0; i < max; i++) {
|
for (i = 0; i < max; i++) {
|
||||||
if (copy)
|
if (copy)
|
||||||
|
@ -127,7 +127,7 @@
|
||||||
local integer i;
|
local integer i;
|
||||||
|
|
||||||
if (!(self = [self initWithCapacity: @args.count + 1]))
|
if (!(self = [self initWithCapacity: @args.count + 1]))
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
[self addObject: firstObj];
|
[self addObject: firstObj];
|
||||||
for (i = 0; i < @args.count; i++) {
|
for (i = 0; i < @args.count; i++) {
|
||||||
|
@ -141,7 +141,7 @@
|
||||||
local integer i;
|
local integer i;
|
||||||
|
|
||||||
if (!(self = [self initWithCapacity: cnt]))
|
if (!(self = [self initWithCapacity: cnt]))
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
for (i = 0; i < cnt; i++) {
|
for (i = 0; i < cnt; i++) {
|
||||||
[self addObject: (id) objs[i]];
|
[self addObject: (id) objs[i]];
|
||||||
|
@ -323,7 +323,7 @@
|
||||||
cause something else to happen).
|
cause something else to happen).
|
||||||
*/
|
*/
|
||||||
tmp = _objs[--count];
|
tmp = _objs[--count];
|
||||||
_objs[i] = NIL;
|
_objs[i] = nil;
|
||||||
[tmp release];
|
[tmp release];
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
@ -338,7 +338,7 @@
|
||||||
local id tmp;
|
local id tmp;
|
||||||
|
|
||||||
tmp = _objs[--count];
|
tmp = _objs[--count];
|
||||||
_objs[count] = NIL;
|
_objs[count] = nil;
|
||||||
[tmp release];
|
[tmp release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
if (!(self = [super init]))
|
if (!(self = [super init]))
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
if (!poolStack)
|
if (!poolStack)
|
||||||
poolStack = [[Array alloc] initWithCapacity: 1];
|
poolStack = [[Array alloc] initWithCapacity: 1];
|
||||||
|
|
|
@ -71,7 +71,7 @@ function PR_FindFunction (string func) = #0;
|
||||||
|
|
||||||
classname = PL_String (PL_ObjectForKey (dict, "classname"));
|
classname = PL_String (PL_ObjectForKey (dict, "classname"));
|
||||||
if (classname == "worldspawn")
|
if (classname == "worldspawn")
|
||||||
ent = NIL;
|
ent = nil;
|
||||||
else
|
else
|
||||||
ent = spawn ();
|
ent = spawn ();
|
||||||
if ((class = obj_lookup_class (classname))) {
|
if ((class = obj_lookup_class (classname))) {
|
||||||
|
|
|
@ -12,14 +12,14 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
count = 0;
|
count = 0;
|
||||||
head = NIL;
|
head = nil;
|
||||||
tail = &head;
|
tail = &head;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
{
|
{
|
||||||
local list_bucket_t [] e, t = NIL; //FIXME t uninitialized
|
local list_bucket_t [] e, t = nil; //FIXME t uninitialized
|
||||||
|
|
||||||
for (e = head; e; e = t) {
|
for (e = head; e; e = t) {
|
||||||
t = e.next;
|
t = e.next;
|
||||||
|
@ -33,7 +33,7 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
{
|
{
|
||||||
local list_bucket_t [] e;
|
local list_bucket_t [] e;
|
||||||
if (index < 0 || index >= count)
|
if (index < 0 || index >= count)
|
||||||
return NIL;
|
return nil;
|
||||||
for (e = head; e && index; index--)
|
for (e = head; e && index; index--)
|
||||||
e = e.next;
|
e = e.next;
|
||||||
return e.obj;
|
return e.obj;
|
||||||
|
@ -42,7 +42,7 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
-(id) head
|
-(id) head
|
||||||
{
|
{
|
||||||
if (!head)
|
if (!head)
|
||||||
return NIL;
|
return nil;
|
||||||
return head.obj;
|
return head.obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
{
|
{
|
||||||
local list_bucket_t [] e = (list_bucket_t []) tail;
|
local list_bucket_t [] e = (list_bucket_t []) tail;
|
||||||
if (!e)
|
if (!e)
|
||||||
return NIL;
|
return nil;
|
||||||
return e.obj;
|
return e.obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
{
|
{
|
||||||
local list_bucket_t [] e = obj_malloc (@sizeof (list_bucket_t));
|
local list_bucket_t [] e = obj_malloc (@sizeof (list_bucket_t));
|
||||||
e.obj = item;
|
e.obj = item;
|
||||||
e.next = NIL;
|
e.next = nil;
|
||||||
e.prev = tail;
|
e.prev = tail;
|
||||||
tail[0] = e;
|
tail[0] = e;
|
||||||
tail = &e.next;
|
tail = &e.next;
|
||||||
|
@ -91,7 +91,7 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
return item;
|
return item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) removeItemAtHead
|
- (id) removeItemAtHead
|
||||||
|
@ -100,7 +100,7 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
local id obj;
|
local id obj;
|
||||||
|
|
||||||
if (!count)
|
if (!count)
|
||||||
return NIL;
|
return nil;
|
||||||
e = head;
|
e = head;
|
||||||
obj = e.obj;
|
obj = e.obj;
|
||||||
e.prev[0] = e.next;
|
e.prev[0] = e.next;
|
||||||
|
@ -119,7 +119,7 @@ typedef struct list_bucket_s list_bucket_t;
|
||||||
local id obj;
|
local id obj;
|
||||||
|
|
||||||
if (!count)
|
if (!count)
|
||||||
return NIL;
|
return nil;
|
||||||
e = (list_bucket_t []) tail;
|
e = (list_bucket_t []) tail;
|
||||||
obj = e.obj;
|
obj = e.obj;
|
||||||
e.prev[0] = e.next;
|
e.prev[0] = e.next;
|
||||||
|
|
|
@ -41,10 +41,10 @@
|
||||||
- (id) initWithObject: (id)anObject
|
- (id) initWithObject: (id)anObject
|
||||||
{
|
{
|
||||||
if (!(self = [super init]))
|
if (!(self = [super init]))
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
data = [anObject retain];
|
data = [anObject retain];
|
||||||
nextNode = NIL;
|
nextNode = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) dealloc
|
- (void) dealloc
|
||||||
|
|
|
@ -118,12 +118,12 @@ BOOL (id object) object_is_meta_class = #0;
|
||||||
|
|
||||||
+ (BOOL) instancesRespondToSelector: (SEL)aSelector
|
+ (BOOL) instancesRespondToSelector: (SEL)aSelector
|
||||||
{
|
{
|
||||||
return class_get_instance_method (self, aSelector) != NIL;
|
return class_get_instance_method (self, aSelector) != nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (BOOL) respondsToSelector: (SEL)aSelector
|
+ (BOOL) respondsToSelector: (SEL)aSelector
|
||||||
{
|
{
|
||||||
return (class_get_class_method (self, aSelector) != NIL);
|
return (class_get_class_method (self, aSelector) != nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -133,7 +133,7 @@ BOOL (id object) object_is_meta_class = #0;
|
||||||
+ (IMP) instanceMethodForSelector: (SEL)aSelector
|
+ (IMP) instanceMethodForSelector: (SEL)aSelector
|
||||||
{
|
{
|
||||||
if (!aSelector)
|
if (!aSelector)
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
return method_get_imp (class_get_instance_method (self, aSelector));
|
return method_get_imp (class_get_instance_method (self, aSelector));
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ BOOL (id object) object_is_meta_class = #0;
|
||||||
|
|
||||||
- (BOOL) respondsToSelector: (SEL)aSelector
|
- (BOOL) respondsToSelector: (SEL)aSelector
|
||||||
{
|
{
|
||||||
return (class_get_instance_method ([self class], aSelector) != NIL);
|
return (class_get_instance_method ([self class], aSelector) != nil);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (BOOL) conformsToProtocol: (Protocol [])aProtocol
|
- (BOOL) conformsToProtocol: (Protocol [])aProtocol
|
||||||
|
@ -221,7 +221,7 @@ BOOL (id object) object_is_meta_class = #0;
|
||||||
local Class myClass = [self class];
|
local Class myClass = [self class];
|
||||||
|
|
||||||
if (!aSelector)
|
if (!aSelector)
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
return method_get_imp (object_is_instance (self)
|
return method_get_imp (object_is_instance (self)
|
||||||
? class_get_instance_method (myClass, aSelector)
|
? class_get_instance_method (myClass, aSelector)
|
||||||
|
|
|
@ -24,11 +24,11 @@
|
||||||
|
|
||||||
+ itemClass:(plitem_t) item
|
+ itemClass:(plitem_t) item
|
||||||
{
|
{
|
||||||
local string classname = NIL;
|
local string classname = nil;
|
||||||
local id class;
|
local id class;
|
||||||
|
|
||||||
if (!PL_TEST (item))
|
if (!PL_TEST (item))
|
||||||
return NIL;
|
return nil;
|
||||||
switch (PL_Type (item)) {
|
switch (PL_Type (item)) {
|
||||||
case QFDictionary:
|
case QFDictionary:
|
||||||
classname = "PLDictionary";
|
classname = "PLDictionary";
|
||||||
|
@ -43,7 +43,7 @@
|
||||||
classname = "PLString";
|
classname = "PLString";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
class = obj_lookup_class (classname);
|
class = obj_lookup_class (classname);
|
||||||
return [[class alloc] initWithItem: item];
|
return [[class alloc] initWithItem: item];
|
||||||
|
|
|
@ -55,7 +55,7 @@ struct obj_method_description_list {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (struct obj_method_description []) descriptionForClassMethod: (SEL)aSel
|
- (struct obj_method_description []) descriptionForClassMethod: (SEL)aSel
|
||||||
|
@ -78,7 +78,7 @@ struct obj_method_description_list {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -51,10 +51,10 @@
|
||||||
- (id) pop
|
- (id) pop
|
||||||
{
|
{
|
||||||
local id data;
|
local id data;
|
||||||
local id oldTop = NIL;
|
local id oldTop = nil;
|
||||||
|
|
||||||
if (!top)
|
if (!top)
|
||||||
return NIL;
|
return nil;
|
||||||
|
|
||||||
oldTop = top;
|
oldTop = top;
|
||||||
top = [top nextNode];
|
top = [top nextNode];
|
||||||
|
|
|
@ -43,7 +43,7 @@
|
||||||
{
|
{
|
||||||
local integer index;
|
local integer index;
|
||||||
local Instruction []inst;
|
local Instruction []inst;
|
||||||
literals = [Frame newWithSize: [constants count] link: NIL];
|
literals = [Frame newWithSize: [constants count] link: nil];
|
||||||
code = obj_malloc (@sizeof(instruction_t) * [instructions count]);
|
code = obj_malloc (@sizeof(instruction_t) * [instructions count]);
|
||||||
lineinfo = obj_malloc(@sizeof(lineinfo_t) * [instructions count]);
|
lineinfo = obj_malloc(@sizeof(lineinfo_t) * [instructions count]);
|
||||||
for (index = 0; index < [constants count]; index++) {
|
for (index = 0; index < [constants count]; index++) {
|
||||||
|
@ -59,7 +59,7 @@
|
||||||
size = [instructions count];
|
size = [instructions count];
|
||||||
[instructions release];
|
[instructions release];
|
||||||
[constants release];
|
[constants release];
|
||||||
instructions = constants = NIL;
|
instructions = constants = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (instruction_t []) code
|
- (instruction_t []) code
|
||||||
|
@ -83,12 +83,12 @@
|
||||||
|
|
||||||
if (instructions) {
|
if (instructions) {
|
||||||
temp = instructions;
|
temp = instructions;
|
||||||
instructions = NIL;
|
instructions = nil;
|
||||||
[temp release];
|
[temp release];
|
||||||
}
|
}
|
||||||
if (constants) {
|
if (constants) {
|
||||||
temp = constants;
|
temp = constants;
|
||||||
constants = NIL;
|
constants = nil;
|
||||||
[temp release];
|
[temp release];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ Symbol []beginSym;
|
||||||
sexpr = xp;
|
sexpr = xp;
|
||||||
scope = sc;
|
scope = sc;
|
||||||
code = [CompiledCode new];
|
code = [CompiledCode new];
|
||||||
err = NIL;
|
err = nil;
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,9 +40,9 @@ BOOL isList (SchemeObject []ls)
|
||||||
cdr = d;
|
cdr = d;
|
||||||
|
|
||||||
if (!car) {
|
if (!car) {
|
||||||
print("Cons: WARNING: NIL car\n");
|
print("Cons: WARNING: nil car\n");
|
||||||
} else if (!cdr) {
|
} else if (!cdr) {
|
||||||
print("cons: WARNING: NIL cdr\n");
|
print("cons: WARNING: nil cdr\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return [super init];
|
return [super init];
|
||||||
|
@ -77,16 +77,16 @@ BOOL isList (SchemeObject []ls)
|
||||||
- (string) printForm
|
- (string) printForm
|
||||||
{
|
{
|
||||||
local string acc = "";
|
local string acc = "";
|
||||||
local id cur, next = NIL;
|
local id cur, next = nil;
|
||||||
|
|
||||||
for (cur = self; cur; cur = next) {
|
for (cur = self; cur; cur = next) {
|
||||||
next = [cur cdr];
|
next = [cur cdr];
|
||||||
acc = acc + [[cur car] printForm];
|
acc = acc + [[cur car] printForm];
|
||||||
if (next == [Nil nil]) {
|
if (next == [Nil nil]) {
|
||||||
next = NIL;
|
next = nil;
|
||||||
} else if (next && ![next isKindOfClass: [Cons class]]) {
|
} else if (next && ![next isKindOfClass: [Cons class]]) {
|
||||||
acc = acc + " . " + [next printForm];
|
acc = acc + " . " + [next printForm];
|
||||||
next = NIL;
|
next = nil;
|
||||||
} else if (next) {
|
} else if (next) {
|
||||||
acc = acc + " ";
|
acc = acc + " ";
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
+ (id) type: (string) t message: (string) m
|
+ (id) type: (string) t message: (string) m
|
||||||
{
|
{
|
||||||
return [[self alloc] initWithType: t message: m by: NIL];
|
return [[self alloc] initWithType: t message: m by: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (id) initWithType: (string) t message: (string) m by: (SchemeObject []) o
|
- (id) initWithType: (string) t message: (string) m by: (SchemeObject []) o
|
||||||
|
|
|
@ -4,12 +4,12 @@
|
||||||
@implementation Instruction
|
@implementation Instruction
|
||||||
+ (id) opcode: (opcode_e) oc
|
+ (id) opcode: (opcode_e) oc
|
||||||
{
|
{
|
||||||
return [[self alloc] initWithOpcode: oc operand: 0 label: NIL];
|
return [[self alloc] initWithOpcode: oc operand: 0 label: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id) opcode: (opcode_e) oc operand: (integer) op
|
+ (id) opcode: (opcode_e) oc operand: (integer) op
|
||||||
{
|
{
|
||||||
return [[self alloc] initWithOpcode: oc operand: op label: NIL];
|
return [[self alloc] initWithOpcode: oc operand: op label: nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
+ (id) opcode: (opcode_e) oc label: (Instruction []) l
|
+ (id) opcode: (opcode_e) oc label: (Instruction []) l
|
||||||
|
|
|
@ -112,7 +112,7 @@ BOOL issymbol (string x)
|
||||||
by: self];
|
by: self];
|
||||||
}
|
}
|
||||||
case "":
|
case "":
|
||||||
return NIL;
|
return nil;
|
||||||
default:
|
default:
|
||||||
for (len = 1; issymbol(str_mid(source, len, len+1)); len++);
|
for (len = 1; issymbol(str_mid(source, len, len+1)); len++);
|
||||||
sym = [Symbol forString: str_mid (source, 0, len)];
|
sym = [Symbol forString: str_mid (source, 0, len)];
|
||||||
|
|
|
@ -23,16 +23,16 @@ void GlobalFree (void []ele, void []data)
|
||||||
- (id) init
|
- (id) init
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
state.program = NIL;
|
state.program = nil;
|
||||||
state.pc = 0;
|
state.pc = 0;
|
||||||
value = NIL;
|
value = nil;
|
||||||
state.cont = NIL;
|
state.cont = nil;
|
||||||
state.env = NIL;
|
state.env = nil;
|
||||||
state.literals = NIL;
|
state.literals = nil;
|
||||||
state.proc = NIL;
|
state.proc = nil;
|
||||||
state.stack = [Nil nil];
|
state.stack = [Nil nil];
|
||||||
state.lineinfo = NIL;
|
state.lineinfo = nil;
|
||||||
globals = Hash_NewTable(1024, GlobalGetKey, GlobalFree, NIL);
|
globals = Hash_NewTable(1024, GlobalGetKey, GlobalFree, nil);
|
||||||
all_globals = [Nil nil];
|
all_globals = [Nil nil];
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!token) {
|
if (!token) {
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token == [Symbol leftParen]) {
|
if (token == [Symbol leftParen]) {
|
||||||
|
|
|
@ -20,7 +20,7 @@ integer checkpoint;
|
||||||
|
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
maybe_garbage = not_garbage = not_garbage_end = wait_list = roots = NIL;
|
maybe_garbage = not_garbage = not_garbage_end = wait_list = roots = nil;
|
||||||
markstate = true;
|
markstate = true;
|
||||||
gc_state = GC_IDLE;
|
gc_state = GC_IDLE;
|
||||||
checkpoint = 0;
|
checkpoint = 0;
|
||||||
|
@ -29,7 +29,7 @@ integer checkpoint;
|
||||||
- (id) initDummy
|
- (id) initDummy
|
||||||
{
|
{
|
||||||
self = [super init];
|
self = [super init];
|
||||||
prev = next = NIL;
|
prev = next = nil;
|
||||||
marked = markstate;
|
marked = markstate;
|
||||||
root = false;
|
root = false;
|
||||||
return self;
|
return self;
|
||||||
|
@ -88,9 +88,9 @@ integer checkpoint;
|
||||||
if (wait_list) {
|
if (wait_list) {
|
||||||
wait_list.prev = not_garbage_end;
|
wait_list.prev = not_garbage_end;
|
||||||
}
|
}
|
||||||
wait_list = NIL;
|
wait_list = nil;
|
||||||
not_garbage_end = NIL;
|
not_garbage_end = nil;
|
||||||
not_garbage = NIL;
|
not_garbage = nil;
|
||||||
markstate = !markstate;
|
markstate = !markstate;
|
||||||
gc_state = GC_IDLE;
|
gc_state = GC_IDLE;
|
||||||
}
|
}
|
||||||
|
@ -134,7 +134,7 @@ integer checkpoint;
|
||||||
dprintf("GC: Not during collect: %i\n", (integer) self);
|
dprintf("GC: Not during collect: %i\n", (integer) self);
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = NIL;
|
prev = nil;
|
||||||
root = false;
|
root = false;
|
||||||
checkpoint++;
|
checkpoint++;
|
||||||
return self;
|
return self;
|
||||||
|
@ -157,7 +157,7 @@ integer checkpoint;
|
||||||
not_garbage.prev = self;
|
not_garbage.prev = self;
|
||||||
}
|
}
|
||||||
next = not_garbage;
|
next = not_garbage;
|
||||||
prev = NIL;
|
prev = nil;
|
||||||
not_garbage = self;
|
not_garbage = self;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ integer checkpoint;
|
||||||
roots.prev = self;
|
roots.prev = self;
|
||||||
}
|
}
|
||||||
next = roots;
|
next = roots;
|
||||||
prev = NIL;
|
prev = nil;
|
||||||
roots = self;
|
roots = self;
|
||||||
root = true;
|
root = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
if (names) {
|
if (names) {
|
||||||
[names release];
|
[names release];
|
||||||
}
|
}
|
||||||
names = NIL;
|
names = nil;
|
||||||
[super dealloc];
|
[super dealloc];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ Symbol []symbol (string str)
|
||||||
@implementation Symbol
|
@implementation Symbol
|
||||||
+ (void) initialize
|
+ (void) initialize
|
||||||
{
|
{
|
||||||
symbols = Hash_NewTable (1024, SymbolGetKey, SymbolFree, NIL);
|
symbols = Hash_NewTable (1024, SymbolGetKey, SymbolFree, nil);
|
||||||
lparen = [Symbol forString: "("];
|
lparen = [Symbol forString: "("];
|
||||||
rparen = [Symbol forString: ")"];
|
rparen = [Symbol forString: ")"];
|
||||||
quote = [Symbol forString: "'"];
|
quote = [Symbol forString: "'"];
|
||||||
|
|
|
@ -226,7 +226,7 @@ SchemeObject []bi_apply (SchemeObject []args, Machine []m)
|
||||||
by: m];
|
by: m];
|
||||||
}
|
}
|
||||||
|
|
||||||
prev = NIL;
|
prev = nil;
|
||||||
|
|
||||||
for (cur = args; [(Cons[]) cur cdr] != [Nil nil]; cur = [(Cons[]) cur cdr]) {
|
for (cur = args; [(Cons[]) cur cdr] != [Nil nil]; cur = [(Cons[]) cur cdr]) {
|
||||||
prev = cur;
|
prev = cur;
|
||||||
|
@ -238,7 +238,7 @@ SchemeObject []bi_apply (SchemeObject []args, Machine []m)
|
||||||
|
|
||||||
[m stack: [(Cons[]) args cdr]];
|
[m stack: [(Cons[]) args cdr]];
|
||||||
[(Procedure[]) [(Cons[]) args car] invokeOnMachine: m];
|
[(Procedure[]) [(Cons[]) args car] invokeOnMachine: m];
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
SchemeObject []bi_callcc (SchemeObject []args, Machine []m)
|
SchemeObject []bi_callcc (SchemeObject []args, Machine []m)
|
||||||
|
@ -261,7 +261,7 @@ SchemeObject []bi_callcc (SchemeObject []args, Machine []m)
|
||||||
[Nil nil])];
|
[Nil nil])];
|
||||||
}
|
}
|
||||||
[(Procedure[]) [(Cons[]) args car] invokeOnMachine: m];
|
[(Procedure[]) [(Cons[]) args car] invokeOnMachine: m];
|
||||||
return NIL;
|
return nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
SchemeObject []bi_eq (SchemeObject []args, Machine []m)
|
SchemeObject []bi_eq (SchemeObject []args, Machine []m)
|
||||||
|
|
|
@ -53,14 +53,14 @@ integer main (integer argc, string []argv)
|
||||||
comp = [Compiler newWithLambda: cons ([Symbol forString: "lambda"],
|
comp = [Compiler newWithLambda: cons ([Symbol forString: "lambda"],
|
||||||
cons ([Nil nil],
|
cons ([Nil nil],
|
||||||
cons(stuff, [Nil nil])))
|
cons(stuff, [Nil nil])))
|
||||||
scope: NIL];
|
scope: nil];
|
||||||
code = (CompiledCode) [comp compile];
|
code = (CompiledCode) [comp compile];
|
||||||
if ([code isError]) {
|
if ([code isError]) {
|
||||||
printf(">> %s: %i\n", [code source], [code line]);
|
printf(">> %s: %i\n", [code source], [code line]);
|
||||||
printf(">> Error (%s): %s\n", [code type], [code message]);
|
printf(">> Error (%s): %s\n", [code type], [code message]);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
lm = [Lambda newWithCode: code environment: NIL];
|
lm = [Lambda newWithCode: code environment: nil];
|
||||||
[lm invokeOnMachine: vm];
|
[lm invokeOnMachine: vm];
|
||||||
res = [vm run];
|
res = [vm run];
|
||||||
if ([res isError]) {
|
if ([res isError]) {
|
||||||
|
|
|
@ -299,7 +299,7 @@ static keyword_t keywords[] = {
|
||||||
{"switch", SWITCH, 0, 0, PROG_ID_VERSION},
|
{"switch", SWITCH, 0, 0, PROG_ID_VERSION},
|
||||||
{"case", CASE, 0, 0, PROG_ID_VERSION},
|
{"case", CASE, 0, 0, PROG_ID_VERSION},
|
||||||
{"default", DEFAULT, 0, 0, PROG_ID_VERSION},
|
{"default", DEFAULT, 0, 0, PROG_ID_VERSION},
|
||||||
{"NIL", NIL, 0, 0, PROG_ID_VERSION},
|
{"nil", NIL, 0, 0, PROG_ID_VERSION},
|
||||||
{"struct", STRUCT, 0, 0, PROG_VERSION},
|
{"struct", STRUCT, 0, 0, PROG_VERSION},
|
||||||
{"union", UNION, 0, 0, PROG_VERSION},
|
{"union", UNION, 0, 0, PROG_VERSION},
|
||||||
{"enum", ENUM, 0, 0, PROG_ID_VERSION},
|
{"enum", ENUM, 0, 0, PROG_ID_VERSION},
|
||||||
|
|
Loading…
Reference in a new issue