rev 143 - in trunk: include/prothon modules/File modules/Float modules/List modules/Re modules/String modules/Tuple src
SVN User <[email protected]>
| Newsgroups | gmane.comp.lang.prothon.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: bcollins
Date: 2004-03-26 19:49:13 -0500 (Fri, 26 Mar 2004)
New Revision: 143
Modified:
trunk/include/prothon/prothon.h
trunk/modules/File/File.c
trunk/modules/Float/Float.c
trunk/modules/List/List.c
trunk/modules/Re/Re.c
trunk/modules/String/String.c
trunk/modules/Tuple/Tuple.c
trunk/src/argproc.c
trunk/src/builtins.c
trunk/src/clist.c
trunk/src/console.c
trunk/src/getline.c
trunk/src/interp.c
trunk/src/lock.c
trunk/src/main.c
trunk/src/memory_mgr.c
trunk/src/object.c
trunk/src/object.h
trunk/src/parser_routines.c
trunk/src/sys.c
trunk/src/thread.c
Log:
GLobally change FALSE->PR_FALSE and TRUE->PR_TRUE
Modified: trunk/include/prothon/prothon.h
===================================================================
--- trunk/include/prothon/prothon.h 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/include/prothon/prothon.h 2004-03-27 00:49:13 UTC (rev 143)
@@ -185,13 +185,11 @@
//************************* WELL-KNOWN-OBJECTS ********************************
// these are created at object system initialization
-#undef TRUE
-#undef FALSE
typedef enum {
// "singleton" objects
- FALSE =0, // 0 False
- TRUE, // 1 True
+ PR_FALSE =0, // 0 False
+ PR_TRUE, // 1 True
OBJECT, // 2 Object
NONE, // 3 None
@@ -245,7 +243,7 @@
obj_p OBJ_[OBJ_ENUM_COUNT];
// Use OBJ(OBJNAME) to access well-known objects
-// example: OBJ(OBJECT) or OBJ(TRUE)
+// example: OBJ(OBJECT) or OBJ(PR_TRUE)
//************************* WELL-KNOWN-SYMBOLS ********************************
// actual symbols are lower-case versions of these constants
@@ -412,21 +410,21 @@
// DEL_ATTR: Find attr in object that matches a key and delete it.
// Much like get-attr, except that when an attr is found it is deleted.
-// If no attr is found to delete it returns FALSE, else TRUE.
+// If no attr is found to delete it returns PR_FALSE, else PR_TRUE.
int del_attr(isp ist, obj_p obj, obj_p key);
// INS_PROTO: Insert an object in the list of proto objects.
// This is the immediate protos for an object, not the reachable.
// Pos == 0 means head of list and pos >= len means append at end.
-// Duplicates will be ignored. TRUE will be returned if the proto
-// was inserted, FALSE if not.
+// Duplicates will be ignored. PR_TRUE will be returned if the proto
+// was inserted, PR_FALSE if not.
int ins_proto(isp ist, obj_p obj, obj_p proto, int pos);
// DEL_PROTO: Delete an object from the list of proto objects.
// This is from the immediate proto list for an object, not the reachable.
// You must pass the exact object to be deleted.
-// The last proto may not be deleted. TRUE will be returned if the proto
-// was found and deleted, FALSE if not.
+// The last proto may not be deleted. PR_TRUE will be returned if the proto
+// was found and deleted, PR_FALSE if not.
int del_proto(isp ist, obj_p obj, obj_p proto);
// PROTO_LEN: Get number of protos in an object
@@ -447,7 +445,7 @@
// or have a circular reference. See section "INTERPRETER STATE" below.
obj_p proto_list(isp ist, obj_p object);
-// HAS_PROTO: Returns TRUE if second object is in reachable proto list of first object
+// HAS_PROTO: Returns PR_TRUE if second object is in reachable proto list of first object
// The ist param may return an exception object if proto pointers are missing
// or have a circular reference. See section "INTERPRETER STATE" below.
int has_proto(isp ist, obj_p obj, obj_p obj_proto);
@@ -546,7 +544,7 @@
// function is called on the existing key in the dict with the passed key as the parameter.
// If the keys match, then the value in the dictionary is replaced and the existing key
// is left in place. If there is no match the ky and value are added.
-// The function returns TRUE if there was no match and a new entry was added and it returns
+// The function returns PR_TRUE if there was no match and a new entry was added and it returns
// false if a value was replaced for an existing key.
int dict_add(isp ist, obj_p dict_obj, obj_p key_in, obj_p value_in);
@@ -567,7 +565,7 @@
// when read-locked) then the order will stay the same. The order will match
// the order of values given by dict_values() if they are both called while the
// dict is read-locked.
-#define dict_keys(ist, dict_obj) dict_keys_values(ist, dict_obj, TRUE)
+#define dict_keys(ist, dict_obj) dict_keys_values(ist, dict_obj, PR_TRUE)
obj_p dict_keys_values(isp ist, obj_p dict_obj, int key_flg);
// DICT_VALUES: Return a list object containing all values in the dictionary.
@@ -576,7 +574,7 @@
// when read-locked) then the order will stay the same. The order will match
// the order of keys given by dict_keys() if they are both called while the
// dict is read-locked.
-#define dict_values(ist, dict_obj) dict_keys_values(ist, dict_obj, FALSE)
+#define dict_values(ist, dict_obj) dict_keys_values(ist, dict_obj, PR_FALSE)
// HASH_MASK: Maximum value for any hash function to return.
// Minimum value is 1.
@@ -735,7 +733,7 @@
// int type. Covering a value does not mean that some precision will not be lost.
// This test determines when coercion is allowed. It is up to the prototype
// objects to decide which objects they cover by offering the __covers__ function.
-#define covers(o1, o2) (call_func1((ist), (o1), SYM(__COVERS__), (o2)) == OBJ(TRUE))
+#define covers(o1, o2) (call_func1((ist), (o1), SYM(__COVERS__), (o2)) == OBJ(PR_TRUE))
//********************************* EXCEPTIONS ******************************************
// Exceptions are raised by calling raise_exception(ist, proto, doc). Proto is a proto
Modified: trunk/modules/File/File.c
===================================================================
--- trunk/modules/File/File.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/modules/File/File.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -169,8 +169,8 @@
}
DEF(FILE_PROTO, closed, NULL) {
- if (OPEN(self)) return OBJ(FALSE);
- else return OBJ(TRUE);
+ if (OPEN(self)) return OBJ(PR_FALSE);
+ else return OBJ(PR_TRUE);
}
DEF(FILE_PROTO, flush, NULL) {
@@ -198,12 +198,12 @@
raise_exception(ist, OBJ(IOEXCEPTION), "isatty called on closed stream");
return NULL;
}
- if (_isatty(_fileno(STREAM(self)))) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (_isatty(_fileno(STREAM(self)))) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
#endif
DEF(FILE_PROTO, read, list2( sym(ist, "size"), new_int_obj(-1))) {
- int readall = FALSE;
+ int readall = PR_FALSE;
i64_t size_in;
size_t size, total_read=0, num_read;
obj_p str_obj;
@@ -223,7 +223,7 @@
size_in = parms[1]->data.i64;
if (!size_in) return new_string_obj("");
if (size_in < 0) {
- readall = TRUE;
+ readall = PR_TRUE;
size = BUFSIZE(self);
} else
size = (size_t) size_in;
@@ -268,12 +268,12 @@
buf = obj_str->str;
}
buf[total_read] = 0;
- str_obj->unmutable = TRUE;
+ str_obj->unmutable = PR_TRUE;
return str_obj;
}
DEF(FILE_PROTO, readline, list2( sym(ist, "size"), new_int_obj(-1))) {
- int readall = FALSE;
+ int readall = PR_FALSE;
i64_t size_in;
size_t size, total_read;
obj_p str_obj;
@@ -293,7 +293,7 @@
size_in = parms[1]->data.i64;
if (!size_in) return new_string_obj("");
if (size_in < 0) {
- readall = TRUE;
+ readall = PR_TRUE;
size = BUFSIZE(self);
} else
size = (size_t) size_in;
@@ -336,12 +336,12 @@
obj_str->len = total_read;
}
buf[total_read] = 0;
- str_obj->unmutable = TRUE;
+ str_obj->unmutable = PR_TRUE;
return str_obj;
}
DEF(FILE_PROTO, readlines, list2( sym(ist, "size"), new_int_obj(-1))) {
- int readall = FALSE;
+ int readall = PR_FALSE;
i64_t size_in;
size_t size, total_read=0, num_read;
obj_p str_obj, list_obj;
@@ -361,7 +361,7 @@
size_in = parms[1]->data.i64;
if (!size_in) return new_string_obj("");
if (size_in < 0) {
- readall = TRUE;
+ readall = PR_TRUE;
size = BUFSIZE(self);
} else
size = (size_t) size_in;
@@ -410,7 +410,7 @@
obj_str->len = num_read;
}
buf[num_read] = 0;
- str_obj->unmutable = TRUE;
+ str_obj->unmutable = PR_TRUE;
list_append(ist, list_obj, str_obj);
}
return list_obj;
Modified: trunk/modules/Float/Float.c
===================================================================
--- trunk/modules/Float/Float.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/modules/Float/Float.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -64,8 +64,8 @@
#define Float_value(objid) (objid->data.f64)
DEF(FLOAT_PROTO_OBJ, __bool__, NULL) {
- if (Float_value(self) != 0.0 ) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (Float_value(self) != 0.0 ) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(FLOAT_PROTO_OBJ, __hash__, NULL) {
@@ -281,11 +281,11 @@
else {
if (covers(other, self))
return call_func1(ist, other, SYM(__EQ__), self);
- return OBJ(FALSE);
+ return OBJ(PR_FALSE);
}
}
- if (Float_value(self) == float_other) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (Float_value(self) == float_other) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(FLOAT_PROTO_OBJ, __str__, NULL){
@@ -295,8 +295,8 @@
}
DEF(FLOAT_PROTO_OBJ, __covers__, FORM_RPARAM) {
- if (has_proto(ist, parms[1], OBJ(INT_PROTO))) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (has_proto(ist, parms[1], OBJ(INT_PROTO))) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(FLOAT_PROTO_OBJ, __coerce__, FORM_RPARAM) {
Modified: trunk/modules/List/List.c
===================================================================
--- trunk/modules/List/List.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/modules/List/List.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -171,7 +171,7 @@
selfp = self->data.ptr;
self_len = lstplen(selfp);
for (i=0; i < self_len; i++) {
- if (call_func1(ist, listitem(self, i), SYM(__EQ__), parms[1]) == OBJ(TRUE)) break;
+ if (call_func1(ist, listitem(self, i), SYM(__EQ__), parms[1]) == OBJ(PR_TRUE)) break;
if_exc_return NULL;
}
if (i == self_len) {
Modified: trunk/modules/Re/Re.c
===================================================================
--- trunk/modules/Re/Re.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/modules/Re/Re.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -123,7 +123,7 @@
s = strch(parms[1]);
m = pr_malloc((ngrps+1)*sizeof(regmatch_t));
m[0].rm_so = -1; m[0].rm_eo = 0;
- while(TRUE) {
+ while(PR_TRUE) {
if (m[0].rm_so == m[0].rm_eo) m[0].rm_eo++;
m[0].rm_so = m[0].rm_eo; m[0].rm_eo = strlen(s);
if ((err = regexec(e, s, ngrps+1, m, REG_STARTEND|(m[0].rm_so ? REG_NOTBOL : 0)))) {
@@ -157,7 +157,7 @@
else list_append(ist, tuple_obj, new_string_n_obj(s+sp,ep-sp));
}
list_append(ist, res, tuple_obj);
- tuple_obj->unmutable = TRUE;
+ tuple_obj->unmutable = PR_TRUE;
}
}
pr_free(m);
@@ -243,7 +243,7 @@
m = pr_malloc((ngrps+1)*sizeof(regmatch_t));
m[0].rm_so = -1; m[0].rm_eo = 0;
last_split = 0;
- while(TRUE) {
+ while(PR_TRUE) {
if (m[0].rm_so == m[0].rm_eo) m[0].rm_eo++;
m[0].rm_so = m[0].rm_eo; m[0].rm_eo = strlen(s);
if ((err = regexec(e, s, ngrps+1, m, REG_STARTEND|(m[0].rm_so ? REG_NOTBOL : 0)))) {
@@ -356,10 +356,10 @@
}
}
*(*p2)=0;
- return FALSE;
+ return PR_FALSE;
err:
raise_exception(ist, RE_EXC, "invalid escape sequence");
- return TRUE;
+ return PR_TRUE;
}
DEF( RE_PROTO, sub, list6( sym(ist, "repl"), NULL,
@@ -369,7 +369,7 @@
size_t size;
regmatch_t* m;
regoff_t last_split;
- int i, last_index=0, repl_is_func=FALSE, count, err, ngrps = numgrps(self);
+ int i, last_index=0, repl_is_func=PR_FALSE, count, err, ngrps = numgrps(self);
obj_p lastindex_obj, repl_obj, res_obj, match_obj, arr[2];
regex_t* e = self->data.ptr;
if ( !has_proto(ist, parms[1], OBJ(STRING_PROTO)) &&
@@ -400,7 +400,7 @@
m[0].rm_so = -1; m[0].rm_eo = 0;
last_split = 0;
res = pr_malloc(1); res[0]=0;
- while(TRUE) {
+ while(PR_TRUE) {
if (m[0].rm_so == m[0].rm_eo) m[0].rm_eo++;
m[0].rm_so = m[0].rm_eo; m[0].rm_eo = strlen(orig_s);
if ((err = regexec(e, orig_s, ngrps+1, m, REG_STARTEND|(m[0].rm_so ? REG_NOTBOL : 0)))) {
@@ -526,7 +526,7 @@
res = new_tuple_obj(2);
list_append(ist, res, list_item(ist, self, 2*grp ));
list_append(ist, res, list_item(ist, self, 2*grp+1));
- res->unmutable = TRUE;
+ res->unmutable = PR_TRUE;
return res;
}
@@ -598,7 +598,7 @@
if (sp == -1) list_append(ist, res, OBJ(NONE));
else list_append(ist, res, new_string_n_obj(orig_s+sp, ep-sp));
}
- res->unmutable = TRUE;
+ res->unmutable = PR_TRUE;
return res;
}
}
@@ -615,7 +615,7 @@
if (sp == -1) list_append(ist, res, parms[1]);
else list_append(ist, res, new_string_n_obj(orig_s+sp, ep-sp));
}
- res->unmutable = TRUE;
+ res->unmutable = PR_TRUE;
return res;
}
Modified: trunk/modules/String/String.c
===================================================================
--- trunk/modules/String/String.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/modules/String/String.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -64,10 +64,10 @@
DEF(STR_PROTO_OBJ, __eq__, FORM_RPARAM){
obj_p other = parms[1];
- if (self == other) return OBJ(TRUE);
+ if (self == other) return OBJ(PR_TRUE);
if ( !is_String(other) ||
- strcmp(strch(self), strch(other)) ) return OBJ(FALSE);
- else return OBJ(TRUE);
+ strcmp(strch(self), strch(other)) ) return OBJ(PR_FALSE);
+ else return OBJ(PR_TRUE);
}
DEF(STR_PROTO_OBJ, cmp, FORM_RPARAM){
@@ -101,7 +101,7 @@
memcpy(&(obj_str->str[slen]), strch(other), olen);
obj_str->str[tlen] = 0;
}
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
return obj;
}
@@ -135,7 +135,7 @@
memcpy(obj_str->str+i*len, strch(self), len);
obj_str->str[tlen] = 0;
}
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
return obj;
}
@@ -216,7 +216,7 @@
}
}
dest_ptr[tlen] = 0;
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
del_unlock(str_list);
return obj;
}
@@ -224,15 +224,15 @@
DEF(STR_PROTO_OBJ, __in__, FORM_RPARAM) {
if (!has_proto(ist, parms[1], OBJ(STRING_PROTO)))
return call_func1(ist, parms[1], SYM(__RIN__), self);
- if (strstr(strch(parms[1]), strch(self))) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (strstr(strch(parms[1]), strch(self))) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(STR_PROTO_OBJ, __notin__, FORM_RPARAM) {
if (!has_proto(ist, parms[1], OBJ(STRING_PROTO)))
return call_func1(ist, parms[1], SYM(__RNOTIN__), self);
- if (strstr(strch(parms[1]), strch(self))) return OBJ(FALSE);
- else return OBJ(TRUE);
+ if (strstr(strch(parms[1]), strch(self))) return OBJ(PR_FALSE);
+ else return OBJ(PR_TRUE);
}
DEF(STR_PROTO_OBJ, len, NULL) {
Modified: trunk/modules/Tuple/Tuple.c
===================================================================
--- trunk/modules/Tuple/Tuple.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/modules/Tuple/Tuple.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -65,11 +65,11 @@
obj_p item, tgt = parms[1];
for(i=0; i < llen; i++) {
item = list_item(ist, self, i);
- if (call_func1(ist, item, SYM(__EQ__), tgt) == OBJ(TRUE))
- return OBJ(TRUE);
+ if (call_func1(ist, item, SYM(__EQ__), tgt) == OBJ(PR_TRUE))
+ return OBJ(PR_TRUE);
else if_exc_return NULL;
}
- return OBJ(FALSE);
+ return OBJ(PR_FALSE);
}
DEF(TUPLE_PROTO_OBJ, __rnotin__, FORM_RPARAM) {
@@ -77,11 +77,11 @@
obj_p item, tgt = parms[1];
for(i=0; i < llen; i++) {
item = list_item(ist, self, i);
- if (call_func1(ist, item, SYM(__EQ__), tgt) == OBJ(TRUE))
- return OBJ(FALSE);
+ if (call_func1(ist, item, SYM(__EQ__), tgt) == OBJ(PR_TRUE))
+ return OBJ(PR_FALSE);
else if_exc_return NULL;
}
- return OBJ(TRUE);
+ return OBJ(PR_TRUE);
}
DEF(TUPLE_PROTO_OBJ, __add__, FORM_RPARAM) {
@@ -108,7 +108,7 @@
size = len*times;
if(times == 0) {
obj_p res = new_tuple_obj(0);
- res ->unmutable = TRUE;
+ res ->unmutable = PR_TRUE;
return res;
}
if(times == 1) return self;
@@ -163,7 +163,7 @@
DEF(TUPLE_PROTO_OBJ, count, FORM_RPARAM) {
int i, cnt=0, llen = list_len(ist, self);
for (i=0; i < llen; i++) {
- if (call_func1(ist, list_item(ist, self, i), SYM(__EQ__), parms[1]) == OBJ(TRUE))
+ if (call_func1(ist, list_item(ist, self, i), SYM(__EQ__), parms[1]) == OBJ(PR_TRUE))
cnt++;
if_exc_return NULL;
}
@@ -173,7 +173,7 @@
DEF(TUPLE_PROTO_OBJ, index, FORM_RPARAM) {
int i, llen = list_len(ist, self);
for (i=0; i < llen; i++) {
- if (call_func1(ist, list_item(ist, self, i), SYM(__EQ__), parms[1]) == OBJ(TRUE))
+ if (call_func1(ist, list_item(ist, self, i), SYM(__EQ__), parms[1]) == OBJ(PR_TRUE))
return new_int_obj(i);
if_exc_return NULL;
}
Modified: trunk/src/argproc.c
===================================================================
--- trunk/src/argproc.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/argproc.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -93,7 +93,7 @@
}
obj_p arginit(isp ist, int argc, char* argv[]) {
- int i, past_c_args = FALSE;
+ int i, past_c_args = PR_FALSE;
obj_p thread_argv, argv_obj = NULL;
obj_p thread_list = new_list_obj(4), res = new_object(NULL);
char *p, buf[10];
@@ -101,7 +101,7 @@
if (!past_c_args && argv[i][0] != '-') {
argv_obj = new_list_obj(argc - i);
set_attr(ist, res, sym(ist, "argv"), argv_obj);
- past_c_args = TRUE;
+ past_c_args = PR_TRUE;
}
if (past_c_args)
list_append(ist, argv_obj, new_string_obj(argv[i]));
@@ -127,7 +127,7 @@
list_append(ist, thread_list, thread_argv);
break;
case 'i':
- set_attr(ist, res, sym(ist, "i"), OBJ(TRUE));
+ set_attr(ist, res, sym(ist, "i"), OBJ(PR_TRUE));
break;
case 'c':
if (++i == argc) goto err;
Modified: trunk/src/builtins.c
===================================================================
--- trunk/src/builtins.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/builtins.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -68,8 +68,8 @@
}
DEF(OBJECT_OBJ, has_proto, FORM_RPARAM) {
- if (has_proto(ist, self, parms[1])) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (has_proto(ist, self, parms[1])) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, set_proto, FORM_RPARAM) {
@@ -119,23 +119,23 @@
return proto_list(ist, self);
}
-DEF(OBJECT_OBJ, __bool__, NULL) { return OBJ(TRUE); }
+DEF(OBJECT_OBJ, __bool__, NULL) { return OBJ(PR_TRUE); }
DEF(OBJECT_OBJ, __not__, NULL)
{
- if (call_func0(ist, self, SYM(__BOOL__)) == OBJ(TRUE))
- return OBJ(FALSE);
+ if (call_func0(ist, self, SYM(__BOOL__)) == OBJ(PR_TRUE))
+ return OBJ(PR_FALSE);
else
- return OBJ(TRUE);
+ return OBJ(PR_TRUE);
}
DEF(OBJECT_OBJ, __is__, FORM_RPARAM) {
- if (self == parms[1]) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (self == parms[1]) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __isnot__, FORM_RPARAM) {
- if (self != parms[1]) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (self != parms[1]) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __str__, NULL) {
@@ -153,38 +153,38 @@
DEF(OBJECT_OBJ, __eq__, FORM_RPARAM) {
obj_p cmp_obj = call_func1(ist, self, SYM(CMP), parms[1]); if_exc_return NULL;
- if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) == 0) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) == 0) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __ne__, FORM_RPARAM) {
obj_p cmp_obj = call_func1(ist, self, SYM(CMP), parms[1]); if_exc_return NULL;
- if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) != 0) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) != 0) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __lt__, FORM_RPARAM) {
obj_p cmp_obj = call_func1(ist, self, SYM(CMP), parms[1]); if_exc_return NULL;
- if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) < 0) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) < 0) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __le__, FORM_RPARAM) {
obj_p cmp_obj = call_func1(ist, self, SYM(CMP), parms[1]); if_exc_return NULL;
- if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) <= 0) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) <= 0) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __gt__, FORM_RPARAM) {
obj_p cmp_obj = call_func1(ist, self, SYM(CMP), parms[1]); if_exc_return NULL;
- if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) > 0) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) > 0) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __ge__, FORM_RPARAM) {
obj_p cmp_obj = call_func1(ist, self, SYM(CMP), parms[1]); if_exc_return NULL;
- if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) >= 0) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (cmp_obj && *((i64_t*)(obj_data_p(cmp_obj))) >= 0) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(OBJECT_OBJ, __in__, FORM_RPARAM) {
@@ -195,29 +195,29 @@
return call_func1(ist, parms[1], SYM(__RNOTIN__), self);
}
-// ***************************** FALSE *****************************************
-#define FALSE_OBJ OBJ(FALSE)
-DEF(FALSE_OBJ, __str__, NULL) { return new_string_obj("False"); }
-DEF(FALSE_OBJ, __bool__, NULL) { return OBJ(FALSE); }
-DEF(FALSE_OBJ, cmp, FORM_RPARAM) {
- if (parms[1] == OBJ(FALSE)) return new_int_obj(0);
+// ***************************** PR_FALSE *****************************************
+#define PR_FALSE_OBJ OBJ(PR_FALSE)
+DEF(PR_FALSE_OBJ, __str__, NULL) { return new_string_obj("False"); }
+DEF(PR_FALSE_OBJ, __bool__, NULL) { return OBJ(PR_FALSE); }
+DEF(PR_FALSE_OBJ, cmp, FORM_RPARAM) {
+ if (parms[1] == OBJ(PR_FALSE)) return new_int_obj(0);
return new_int_obj(-1);
}
-// ***************************** TRUE *****************************************
-#define TRUE_OBJ OBJ(TRUE)
-DEF(TRUE_OBJ, __str__, NULL) { return new_string_obj("True"); }
-DEF(TRUE_OBJ, __bool__, NULL) { return OBJ(TRUE); }
-DEF(TRUE_OBJ, cmp, FORM_RPARAM) {
- if (parms[1] == OBJ(FALSE)) return new_int_obj(1);
- if (parms[1] == OBJ(TRUE)) return new_int_obj(0);
+// ***************************** PR_TRUE *****************************************
+#define PR_TRUE_OBJ OBJ(PR_TRUE)
+DEF(PR_TRUE_OBJ, __str__, NULL) { return new_string_obj("True"); }
+DEF(PR_TRUE_OBJ, __bool__, NULL) { return OBJ(PR_TRUE); }
+DEF(PR_TRUE_OBJ, cmp, FORM_RPARAM) {
+ if (parms[1] == OBJ(PR_FALSE)) return new_int_obj(1);
+ if (parms[1] == OBJ(PR_TRUE)) return new_int_obj(0);
return new_int_obj(-1);
}
// ***************************** NONE *****************************************
#define NONE_OBJ OBJ(NONE)
DEF(NONE_OBJ, __str__, NULL) { return new_string_obj("None"); }
-DEF(NONE_OBJ, __bool__, NULL) { return OBJ(FALSE); }
+DEF(NONE_OBJ, __bool__, NULL) { return OBJ(PR_FALSE); }
// ***************************** EXCEPTION ************************************
#define EXCEPTION_OBJ OBJ(EXCEPTION)
@@ -287,7 +287,7 @@
static obj_p get_sequence_item(isp ist, obj_p self, obj_p slice, int seq_type) {
obj_p res = NULL, slice_item1, slice_item2, slice_item3;
- int i, index1 = 0, index2 = 0, index3 = 0, slice1_empty=FALSE, slice2_empty=FALSE;
+ int i, index1 = 0, index2 = 0, index3 = 0, slice1_empty=PR_FALSE, slice2_empty=PR_FALSE;
int exp_len, self_len, slice_len = list_len(ist, slice);
char* self_str = NULL;
if (seq_type == SEQ_TYPE_STRING) {
@@ -297,7 +297,7 @@
self_len = list_len(ist, self);
slice_item1 = list_item(ist, slice,0);
if (slice_item1 == SLICEPARAM_EMPTY || slice_item1 == OBJ(NONE))
- slice1_empty=TRUE;
+ slice1_empty=PR_TRUE;
else {
if (!has_proto(ist, slice_item1, OBJ(INT_PROTO))) {
raise_exception(ist, OBJ(TYPE_EXC), "sequence slice index must be an integer");
@@ -335,7 +335,7 @@
} else index3 = 1;
slice_item2 = list_item(ist, slice,1);
if (slice_item2 == SLICEPARAM_EMPTY || slice_item2 == OBJ(NONE))
- slice2_empty=TRUE;
+ slice2_empty=PR_TRUE;
else {
if (!has_proto(ist, slice_item2, OBJ(INT_PROTO))) {
raise_exception(ist, OBJ(TYPE_EXC), "sequence slice index must be an integer");
@@ -473,13 +473,13 @@
DEF(LIST_OBJ, __setitem__, FORM_PARAM2) {
obj_p slice_item1, slice_item2, slice_item3;
obj_p slice = parms[1], value = parms[3];
- int i, j, new_len, index1 = 0, index2 = 0, index3 = 0, slice1_empty=FALSE, slice2_empty=FALSE;
+ int i, j, new_len, index1 = 0, index2 = 0, index3 = 0, slice1_empty=PR_FALSE, slice2_empty=PR_FALSE;
int exp_len, val_len, self_len, slice_len = list_len(ist, slice);
read_unlock(ist, self); write_lock(ist, self);
self_len = listlen(self);
slice_item1 = list_item(ist, slice,0);
if (slice_item1 == SLICEPARAM_EMPTY || slice_item1 == OBJ(NONE))
- slice1_empty=TRUE;
+ slice1_empty=PR_TRUE;
else {
if (!has_proto(ist, slice_item1, OBJ(INT_PROTO))) {
raise_exception(ist, OBJ(TYPE_EXC), "List slice index must be an integer");
@@ -527,7 +527,7 @@
} else index3 = 1;
slice_item2 = list_item(ist, slice,1);
if (slice_item2 == SLICEPARAM_EMPTY || slice_item2 == OBJ(NONE))
- slice2_empty=TRUE;
+ slice2_empty=PR_TRUE;
else {
if (!has_proto(ist, slice_item2, OBJ(INT_PROTO))) {
raise_exception(ist, OBJ(TYPE_EXC), "sequence slice index must be an integer");
@@ -587,13 +587,13 @@
DEF(LIST_OBJ, __delitem__, FORM_RPARAM) {
obj_p slice_item1, slice_item2, slice_item3;
obj_p slice = parms[1];
- int i, j, new_len, index1 = 0, index2 = 0, index3 = 0, slice1_empty=FALSE, slice2_empty=FALSE;
+ int i, j, new_len, index1 = 0, index2 = 0, index3 = 0, slice1_empty=PR_FALSE, slice2_empty=PR_FALSE;
int exp_len, self_len, slice_len = list_len(ist, slice);
read_unlock(ist, self); write_lock(ist, self);
self_len = listlen(self);
slice_item1 = list_item(ist, slice,0);
if (slice_item1 == SLICEPARAM_EMPTY || slice_item1 == OBJ(NONE))
- slice1_empty=TRUE;
+ slice1_empty=PR_TRUE;
else {
if (!has_proto(ist, slice_item1, OBJ(INT_PROTO))) {
raise_exception(ist, OBJ(TYPE_EXC), "List slice index must be an integer");
@@ -638,7 +638,7 @@
} else index3 = 1;
slice_item2 = list_item(ist, slice,1);
if (slice_item2 == SLICEPARAM_EMPTY || slice_item2 == OBJ(NONE))
- slice2_empty=TRUE;
+ slice2_empty=PR_TRUE;
else {
if (!has_proto(ist, slice_item2, OBJ(INT_PROTO))) {
raise_exception(ist, OBJ(TYPE_EXC), "sequence slice index must be an integer");
@@ -770,7 +770,7 @@
dict = (dict_p) self->data.ptr;
for(i=hash_in; (key=((dp=dictptr(dict,i))->entry.key)); i++){
if ( dp->entry.hash == hash_in &&
- call_func(ist, key, SYM(__EQ__), 2, rp, NULL) == OBJ(TRUE) ) {
+ call_func(ist, key, SYM(__EQ__), 2, rp, NULL) == OBJ(PR_TRUE) ) {
dp->entry.hash = ENTRY_DELETED;
dictlen(dict)--;
write_unlock(ist, self); read_lock(ist, self);
@@ -794,8 +794,8 @@
static obj_p INTGEN_OBJ, SYM_LIMIT;
DEF(INT_OBJ, __bool__, NULL) {
- if (Int_value(self)) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (Int_value(self)) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(INT_OBJ, __hash__, NULL) {
@@ -926,10 +926,10 @@
if (!is_Int(other)) {
if (covers(other, self))
return call_func1(ist, other, SYM(__EQ__), self);
- return OBJ(FALSE);
+ return OBJ(PR_FALSE);
}
- if (Int_value(self) == Int_value(other)) return OBJ(TRUE);
- else return OBJ(FALSE);
+ if (Int_value(self) == Int_value(other)) return OBJ(PR_TRUE);
+ else return OBJ(PR_FALSE);
}
DEF(INT_OBJ, __invert__, NULL){
return new_int_obj( ~ Int_value(self) );
@@ -992,7 +992,7 @@
DEF (INT_OBJ, __gen__, NULL) {
obj_p gen_obj = new_int_obj(0);
- gen_obj->unmutable = FALSE;
+ gen_obj->unmutable = PR_FALSE;
gen_obj->attr_proto.proto = INTGEN_OBJ;
set_attr(ist, gen_obj, SYM_LIMIT, self);
return gen_obj;
@@ -1061,13 +1061,13 @@
OBJECT_OBJ__in__init();
OBJECT_OBJ__notin__init();
- FALSE_OBJ__str__init();
- FALSE_OBJ__bool__init();
- FALSE_OBJcmpinit();
+ PR_FALSE_OBJ__str__init();
+ PR_FALSE_OBJ__bool__init();
+ PR_FALSE_OBJcmpinit();
- TRUE_OBJ__str__init();
- TRUE_OBJ__bool__init();
- TRUE_OBJcmpinit();
+ PR_TRUE_OBJ__str__init();
+ PR_TRUE_OBJ__bool__init();
+ PR_TRUE_OBJcmpinit();
NONE_OBJ__str__init();
NONE_OBJ__bool__init();
Modified: trunk/src/clist.c
===================================================================
--- trunk/src/clist.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/clist.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -135,8 +135,8 @@
int clist_in(clist_p list, void* item) {
int i;
for(i=0; i < list->len; i++)
- if (list->items[i].ptr == item) return TRUE;
- return FALSE;
+ if (list->items[i].ptr == item) return PR_TRUE;
+ return PR_FALSE;
}
//********************************* clist_in_cnt ******************************
@@ -156,9 +156,9 @@
memmove( list->items+i, list->items+i+1,
(list->len-1 - i) * sizeof(clist_item_t) );
list->len--;
- return FALSE;
+ return PR_FALSE;
}
- return TRUE;
+ return PR_TRUE;
}
//********************************* clist_pop_dups ****************************
Modified: trunk/src/console.c
===================================================================
--- trunk/src/console.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/console.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -103,7 +103,7 @@
int i,ind_cnt;
char *d, *s, *lim;
line = Getline(ps1(ist));
- if (!(*line)) return TRUE;
+ if (!(*line)) return PR_TRUE;
Gl_histadd(line);
ind_cnt = indent_cnt(line);
lim = line+strlen(line)+1;
@@ -111,14 +111,14 @@
for (s=line+ind_cnt*INDENT_WIDTH; s < lim; d++, s++) *d = *s;
src = pr_realloc(src, strlen(line)+1);
strcpy(src, line);
- return FALSE;
+ return PR_FALSE;
}
int add_src(isp ist) {
int i,ind_cnt;
char *d, *s, *lim;
line = Getline(ps2(ist));
- if (!(*line)) return TRUE;
+ if (!(*line)) return PR_TRUE;
Gl_histadd(line);
ind_cnt = indent_cnt(line);
lim = line+strlen(line)+1;
@@ -126,7 +126,7 @@
for (s=line+ind_cnt*INDENT_WIDTH; s < lim; d++, s++) *d = *s;
src = pr_realloc(src, strlen(src)+strlen(line)+1);
strcat(src, line);
- return FALSE;
+ return PR_FALSE;
}
int tab_cnt(char* s) {
@@ -183,7 +183,7 @@
obj_p res;
exec_frame_t* frame = NULL;
char buf[16];
- int ind_level = 0, colon_flg = FALSE;
+ int ind_level = 0, colon_flg = PR_FALSE;
char histfile[512], *home;
if ((home = getenv("HOME")) != NULL)
@@ -196,7 +196,7 @@
printf( "Prothon %s Interactive Console, Build %s, %s (Ctrl-D to exit)\n",
PROTHON_VERSION_NUMBER, numonly(PROTHON_VERSION_BUILD, buf), PROTHON_VERSION_DATE );
src = pr_malloc(1);
- while (TRUE) {
+ while (PR_TRUE) {
if (get_src(ist)) goto done;
if (tab_cnt(line)) {
printf ("Error: outer line should not be indented\n");
@@ -213,7 +213,7 @@
if (colon_flg && ind_chg != 1) {
printf ("Error: incorrect indentation for new block\n");
ind_level = 0;
- colon_flg = FALSE;
+ colon_flg = PR_FALSE;
pr_realloc(src, 1); src[0]=0;
break;
}
@@ -221,7 +221,7 @@
}
colon_flg = (strlen(line) >= 2 && src[strlen(line)-2] == ':');
}
- res = exec_string(ist, src, TRUE, &frame);
+ res = exec_string(ist, src, PR_TRUE, &frame);
if (check_exceptions(ist)) {
ist->frame = NULL;
} else {
Modified: trunk/src/getline.c
===================================================================
--- trunk/src/getline.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/getline.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -546,7 +546,7 @@
&cRead // address of number of records read
)) return 0;
- if (pirBuffer.EventType == KEY_EVENT && KeyEvent->bKeyDown == TRUE){
+ if (pirBuffer.EventType == KEY_EVENT && KeyEvent->bKeyDown == PR_TRUE){
iCharCount = KeyEvent->wRepeatCount - 1;
chLastChar = ((int) (KeyEvent->uChar).AsciiChar & 0xffff);
if (!chLastChar)
Modified: trunk/src/interp.c
===================================================================
--- trunk/src/interp.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/interp.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -106,9 +106,9 @@
frame = pr_malloc(sizeof(exec_frame_t) + (code->max_stack_depth+STACK_PADDING) * sizeof(obj_p));
frame->next_frame = NULL;
frame->prev_frame = NULL;
- frame->called_from_c = FALSE;
- frame->do_not_free = FALSE;
- frame->gen_marker = FALSE;
+ frame->called_from_c = PR_FALSE;
+ frame->do_not_free = PR_FALSE;
+ frame->gen_marker = PR_FALSE;
frame->self = self;
frame->globals = (func_obj ? get_attr(ist, func_obj, SYM(__GLOBALS__)) : globals);
frame->syn_locals = (func_obj ? get_attr(ist, func_obj, SYM(__SYN_LOCALS__)) : syn_locals);
@@ -325,14 +325,14 @@
#endif
aprerr = apr_dso_load(&handle, full_path, get_pr_head_pool());
if (aprerr != APR_SUCCESS)
- return FALSE;
+ return PR_FALSE;
aprerr = apr_dso_sym(&dll_entry, handle, "dll_entry");
if (aprerr != APR_SUCCESS) {
sprintf(full_path, "Dll module %s initialization failed", module_name);
apr_dso_unload(handle);
raise_exception(ist, OBJ(INTERNAL_EXC), full_path);
- return FALSE;
+ return PR_FALSE;
}
((void(*)(pr_services_t*))dll_entry)(&dll_services);
@@ -340,7 +340,7 @@
if ((module = get_attr(ist, OBJ(MODULES), sym(ist, module_name))) && dest_module)
set_attr(ist, dest_module, alias, module);
- return TRUE;
+ return PR_TRUE;
}
void add_sep_if_needed(char* path) {
char* p;
@@ -512,7 +512,7 @@
int i, param;
exec_frame_t *switch_frame = NULL, *free_frame = NULL;
exec_frame_t* frame = ist->frame;
- int have_exstk, exc_try_loc = 0, exc_exc_loc = 0, return_flag = FALSE;
+ int have_exstk, exc_try_loc = 0, exc_exc_loc = 0, return_flag = PR_FALSE;
int exc_final=0, exc_final_return=0, stack_lim = frame->code->max_stack_depth;
obj_p exc_waiting=NULL, return_value = 0;
@@ -523,7 +523,7 @@
exc_try_loc = p->try_loc;
exc_exc_loc = p->exc_loc;
}
- while(TRUE){
+ while(PR_TRUE){
while (have_exstk && (fr_pc <= exc_try_loc || fr_pc >= exc_exc_loc)) {
if (exc_final && fr_pc != exc_exc_loc) {
exc_final_return = fr_pc;
@@ -535,7 +535,7 @@
exc_final = p->final;
exc_try_loc = p->try_loc;
exc_exc_loc = p->exc_loc;
- } else have_exstk = FALSE;
+ } else have_exstk = PR_FALSE;
}
if (fr_pc >= fr_code->len){
return_value = do_return(ist, frame, &switch_frame, &free_frame, return_value);
@@ -694,7 +694,7 @@
exec_frame_t* new_frame = new_exec_frame( ist,
frame->self, NULL, NULL,
frame->dyn_locals, frame->locals, func, NULL );
- new_frame->gen_marker = TRUE;
+ new_frame->gen_marker = PR_TRUE;
func->data.ptr = new_frame;
switch_proto_to(ist, func, OBJ(GEN_PROTO));
}
@@ -733,19 +733,19 @@
break;
case OP_TRYFINALLY: {
exception_entry_t* exc_entry = pr_malloc(sizeof(exception_entry_t));
- exc_final = exc_entry->final = TRUE;
+ exc_final = exc_entry->final = PR_TRUE;
exc_try_loc = exc_entry->try_loc = fr_pc;
exc_exc_loc = exc_entry->exc_loc = fr_pc+param;
exstk_push(frame, exc_entry);
- have_exstk = TRUE;
+ have_exstk = PR_TRUE;
} break;
case OP_TRYEXCEPT: {
exception_entry_t* exc_entry = pr_malloc(sizeof(exception_entry_t));
- exc_final = exc_entry->final = FALSE;
+ exc_final = exc_entry->final = PR_FALSE;
exc_try_loc = exc_entry->try_loc = fr_pc;
exc_exc_loc = exc_entry->exc_loc = fr_pc+param;
exstk_push(frame, exc_entry);
- have_exstk = TRUE;
+ have_exstk = PR_TRUE;
} break;
case OP_EXCEPT: {
obj_p exc_proto, exc_obj_label;
@@ -947,13 +947,13 @@
return_flag = fr_ccall;
break;
case OP_IMPORT:
- import_module(ist, frame, param, TRUE, NULL, FALSE);
+ import_module(ist, frame, param, PR_TRUE, NULL, PR_FALSE);
break;
case OP_IMPORT_AS:
- import_module(ist, frame, param-1, TRUE, fr_data(param-1), FALSE);
+ import_module(ist, frame, param-1, PR_TRUE, fr_data(param-1), PR_FALSE);
break;
case OP_IMPORT_PUSH:
- fr_push(import_module(ist, frame, param, FALSE, NULL, TRUE));
+ fr_push(import_module(ist, frame, param, PR_FALSE, NULL, PR_TRUE));
break;
case OP_IMPORT_ATTR: {
obj_p obj;
@@ -1018,7 +1018,7 @@
}
endop:
if (intrp_exobj) {
- int frame_chg = FALSE;
+ int frame_chg = PR_FALSE;
#ifdef TRACE_INTERPRETER
fprintf(tfout, "---exception---\n");
@@ -1034,14 +1034,14 @@
if (!tmp_frame->do_not_free)
pr_free(tmp_frame);
have_exstk = (fr_exstk && clist_len(fr_exstk));
- frame_chg = TRUE;
+ frame_chg = PR_TRUE;
add_frame_to_exception(ist, frame);
}
if (have_exstk) {
if (frame_chg) {
exception_entry_t* p = (exception_entry_t*)(clist_tos(fr_exstk));
exc_exc_loc = p->exc_loc;
- frame_chg = FALSE;
+ frame_chg = PR_FALSE;
}
fr_pc = exc_exc_loc;
pr_free(clist_pop(fr_exstk));
@@ -1050,7 +1050,7 @@
exc_final = p->final;
exc_try_loc = p->try_loc;
exc_exc_loc = p->exc_loc;
- } else have_exstk = FALSE;
+ } else have_exstk = PR_FALSE;
exc_waiting = intrp_exobj;
ist->exception_obj = 0;
continue;
@@ -1130,7 +1130,7 @@
frame = ist->frame;
new_locals = new_object(NULL);
new_frame = new_exec_frame( ist, self, NULL, NULL, dyn_locals, new_locals, func_obj, NULL );
- new_frame->called_from_c = TRUE;
+ new_frame->called_from_c = PR_TRUE;
ist->frame->next_frame = new_frame;
new_frame->prev_frame = ist->frame;
load_frame_params( ist, frame, func_obj, parm_cnt, lbl_val_arr);
@@ -1223,7 +1223,7 @@
new_locals, new_locals, new_locals, NULL, code );
}
}
- new_frame->called_from_c = TRUE;
+ new_frame->called_from_c = PR_TRUE;
new_frame->do_not_free = get_frame;
if (frame) ist->frame->next_frame = new_frame;
new_frame->prev_frame = ist->frame;
@@ -1248,8 +1248,8 @@
set_attr(ist, OBJ(MODULES), module_name, module);
if (exec_string) state = parse_file_or_string(ist, NULL, exec_string);
else state = parse_file_or_string(ist, filename, NULL);
- catch_exception(ist, OBJ(FILENOTFOUND_EXC), NULL); if_exc_return FALSE;
- if (!state || !(code = (state->parse_results))) return FALSE;
+ catch_exception(ist, OBJ(FILENOTFOUND_EXC), NULL); if_exc_return PR_FALSE;
+ if (!state || !(code = (state->parse_results))) return PR_FALSE;
strcpy(name, symch(ist, module_name));
#ifdef DUMP_MODULE_CODE
{ char dump_name[256];
@@ -1263,16 +1263,16 @@
new_locals = new_object(NULL);
set_attr(ist, module, SYM(__LOCALS__), new_locals);
new_frame = new_exec_frame( ist, module, module, dest_module, dyn_locals, new_locals, NULL, code );
- new_frame->called_from_c = TRUE;
+ new_frame->called_from_c = PR_TRUE;
if (frame) ist->frame->next_frame = new_frame;
new_frame->prev_frame = ist->frame;
ist->frame = new_frame;
- exec_loop(ist); if_exc_return FALSE;
+ exec_loop(ist); if_exc_return PR_FALSE;
if (dest_module){
if (!module_alias) module_alias = module_name;
set_attr(ist, dest_module, module_alias, module);
}
- return TRUE;
+ return PR_TRUE;
}
//******************************** main_thread ***********************************
@@ -1293,7 +1293,7 @@
main_threads_started++;
main_threads_running++;
- while(TRUE){
+ while(PR_TRUE){
char name[16], s[8];
strcpy(name, "Main");
sprintf(s,"%d",main_index);
Modified: trunk/src/lock.c
===================================================================
--- trunk/src/lock.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/lock.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -77,7 +77,7 @@
if (!force_wait && lock((obj)->wrlock)) return;
obj_wrlock_waiting++;
apr_thread_mutex_lock(obj_wrlock_mutex);
- while(TRUE) {
+ while(PR_TRUE) {
apr_thread_cond_timedwait(obj_wrlock_cond, obj_wrlock_mutex, PAUSE_MS*1000);
if (lock((obj)->wrlock)) {
obj_wrlock_waiting--;
@@ -89,20 +89,20 @@
//********************************* read_lock_try *****************************
int read_lock_try(isp ist, obj_p obj) {
- if (!lock((obj)->wrlock)) return FALSE;
+ if (!lock((obj)->wrlock)) return PR_FALSE;
if (obj->unmutable) {
free_obj_wrlock(obj);
- return TRUE;
+ return PR_TRUE;
}
if (obj->wrlock_req_cnt) {
free_obj_wrlock(obj);
- return FALSE;
+ return PR_FALSE;
}
clist_push(lockstack, obj);
obj->rdlock_cnt++;
obj->state = OBJ_STATE_NEW_OR_MARKED;
free_obj_wrlock(obj);
- return TRUE;
+ return PR_TRUE;
}
//********************************* read_lock *********************************
@@ -146,18 +146,18 @@
//********************************* write_lock_try ****************************
int write_lock_try(isp ist, obj_p obj) {
- if (!lock((obj)->wrlock)) return FALSE;
+ if (!lock((obj)->wrlock)) return PR_FALSE;
if (obj->unmutable) {
raise_exception(ist, OBJ(LOCK_EXC), "write_lock attempted on an unmutable object");
free_obj_wrlock(obj);
- return FALSE;
+ return PR_FALSE;
}
if (obj->rdlock_cnt || obj->wrlock_req_cnt) {
free_obj_wrlock(obj);
- return FALSE;
+ return PR_FALSE;
}
- obj->long_wrlock = TRUE;
- return TRUE;
+ obj->long_wrlock = PR_TRUE;
+ return PR_TRUE;
}
//********************************* write_lock ********************************
@@ -186,7 +186,7 @@
apr_thread_mutex_unlock(write_mutex);
obj->rdlock_cnt += sav_cnt;
}
- obj->long_wrlock = TRUE;
+ obj->long_wrlock = PR_TRUE;
}
//********************************* write_unlock ******************************
@@ -194,11 +194,11 @@
int write_ready_flag;
if (obj->unmutable) return;
assert(obj->wrlock);
- obj->long_wrlock = FALSE;
- obj->archived = FALSE;
+ obj->long_wrlock = PR_FALSE;
+ obj->archived = PR_FALSE;
obj->state = OBJ_STATE_NEW_OR_MARKED;
if (mem_mgr_phase == MM_PHASE_MARKING && obj->scanned) {
- obj->scanned = FALSE;
+ obj->scanned = PR_FALSE;
pr_lock(&to_be_scanned_list_lock);
if (mem_mgr_phase == MM_PHASE_MARKING)
clist_append(to_be_scanned_list, obj);
@@ -236,7 +236,7 @@
}
lockp->waiting++;
apr_thread_mutex_lock(lockp->mutex);
- while (TRUE) {
+ while (PR_TRUE) {
apr_thread_cond_timedwait(lockp->cond, lockp->mutex, PAUSE_MS*1000);
if (lock(lockp->lock)) {
lockp->waiting--;
@@ -257,13 +257,13 @@
//********************************* del_lock **********************************
void del_lock(obj_p obj) {
get_wrlock(obj, NO_WAIT);
- obj->del_locked = TRUE;
+ obj->del_locked = PR_TRUE;
free_obj_wrlock(obj);
}
//********************************* del_unlock ********************************
void del_unlock(obj_p obj) {
get_wrlock(obj, NO_WAIT);
- obj->del_locked = FALSE;
+ obj->del_locked = PR_FALSE;
free_obj_wrlock(obj);
}
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/main.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -227,7 +227,7 @@
printf("All main threads have terminated, now stopping memory manager ...\n");
#endif
- mem_mgr_req_termination = TRUE;
+ mem_mgr_req_termination = PR_TRUE;
while(!mem_mgr_terminated) apr_sleep(PAUSE_MS*1000);
#ifdef DEBUG_THREADS
Modified: trunk/src/memory_mgr.c
===================================================================
--- trunk/src/memory_mgr.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/memory_mgr.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -98,14 +98,14 @@
}
apr_thread_mutex_unlock(write_mutex);
}
- obj->long_wrlock = TRUE;
+ obj->long_wrlock = PR_TRUE;
}
//********************************* mm_write_unlock ***************************
void mm_write_unlock(obj_p obj) {
int write_ready_flag;
assert(obj->wrlock);
- obj->long_wrlock = FALSE;
+ obj->long_wrlock = PR_FALSE;
write_ready_flag = obj->wrlock_req_cnt;
free_obj_wrlock(obj);
if (write_ready_flag) apr_thread_cond_broadcast(write_cond);
@@ -139,7 +139,7 @@
printf("Memory manager phase: Clearing marks\n");
obj_count = 0; time = clock();
#endif
- mem_mgr_running = TRUE;
+ mem_mgr_running = PR_TRUE;
mem_mgr_phase = MM_PHASE_CLEARING_MARKS;
pr_lock(&object_list_lock);
obj=obj_list_root;
@@ -147,7 +147,7 @@
while(obj) {
mm_write_lock(ist, obj);
obj->state = OBJ_STATE_UNMARKED;
- obj->scanned = FALSE;
+ obj->scanned = PR_FALSE;
mm_write_unlock(obj);
obj_count++;
pr_lock(&object_list_lock);
@@ -165,10 +165,10 @@
to_be_scanned_list = new_clist(1000);
mm_write_lock(ist, obj);
obj->state = OBJ_STATE_NEW_OR_MARKED;
- obj->scanned = TRUE;
+ obj->scanned = PR_TRUE;
mm_write_unlock(obj);
markscan:
- while(TRUE) {
+ while(PR_TRUE) {
obj_p val;
obj_count++;
read_lock(ist, obj);
@@ -180,7 +180,7 @@
if(val > min_obj && val != obj && !val->scanned) {
mm_write_lock(ist, val);
val->state = OBJ_STATE_NEW_OR_MARKED;
- val->scanned = TRUE;
+ val->scanned = PR_TRUE;
mm_write_unlock(val);
pr_lock(&to_be_scanned_list_lock);
clist_append(to_be_scanned_list, val);
@@ -194,7 +194,7 @@
val != obj && !val->scanned ) {
mm_write_lock(ist, val);
val->state = OBJ_STATE_NEW_OR_MARKED;
- val->scanned = TRUE;
+ val->scanned = PR_TRUE;
mm_write_unlock(val);
pr_lock(&to_be_scanned_list_lock);
clist_append(to_be_scanned_list, val);
@@ -221,7 +221,7 @@
if (val > min_obj && val != obj && !val->scanned) {
mm_write_lock(ist, val);
val->state = OBJ_STATE_NEW_OR_MARKED;
- val->scanned = TRUE;
+ val->scanned = PR_TRUE;
mm_write_unlock(val);
pr_lock(&to_be_scanned_list_lock);
clist_append(to_be_scanned_list, val);
@@ -297,8 +297,8 @@
}
if (mem_mgr_req_termination)
mem_mgr_error = MMERR_NORMAL_TERMINATION;
- mem_mgr_running = FALSE;
- mem_mgr_terminated = TRUE;
+ mem_mgr_running = PR_FALSE;
+ mem_mgr_terminated = PR_TRUE;
#ifdef DEBUG_THREADS
printf("Memory manager thread terminating\n");
#endif
Modified: trunk/src/object.c
===================================================================
--- trunk/src/object.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/object.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -132,8 +132,8 @@
OBJ(OBJECT) = new_object(NULL);
OBJ(OBJECT)->attr_proto.proto = OBJ(OBJECT);
OBJ(NONE) = new_object(NULL);
- OBJ(TRUE) = new_object(NULL);
- OBJ(FALSE) = new_object(NULL);
+ OBJ(PR_TRUE) = new_object(NULL);
+ OBJ(PR_FALSE) = new_object(NULL);
OBJ(INT_PROTO) = new_object(NULL);
OBJ(LONG_PROTO) = new_object(NULL);
OBJ(FLOAT_PROTO) = new_object(NULL);
@@ -177,8 +177,8 @@
add_doc_to_obj(ist, OBJ(OBJECT), "Object: proto of all objects");
add_doc_to_obj(ist, OBJ(NONE), "None: represents empty set");
- add_doc_to_obj(ist, OBJ(TRUE), "True: boolean true singleton value");
- add_doc_to_obj(ist, OBJ(FALSE), "False: boolean false singleton value");
+ add_doc_to_obj(ist, OBJ(PR_TRUE), "True: boolean true singleton value");
+ add_doc_to_obj(ist, OBJ(PR_FALSE), "False: boolean false singleton value");
add_doc_to_obj(ist, OBJ(SYMBOL_PROTO), "Symbol object prototype");
add_doc_to_obj(ist, OBJ(INT_PROTO), "Integer number object prototype");
add_doc_to_obj(ist, OBJ(FLOAT_PROTO), "Float number object prototype");
@@ -267,8 +267,8 @@
set_attr(ist, OBJ(OBJECT), sym(ist, "Symbols"), OBJ(SYMBOLS));
set_attr(ist, OBJ(OBJECT), sym(ist, "None"), OBJ(NONE));
- set_attr(ist, OBJ(OBJECT), sym(ist, "True"), OBJ(TRUE));
- set_attr(ist, OBJ(OBJECT), sym(ist, "False"), OBJ(FALSE));
+ set_attr(ist, OBJ(OBJECT), sym(ist, "True"), OBJ(PR_TRUE));
+ set_attr(ist, OBJ(OBJECT), sym(ist, "False"), OBJ(PR_FALSE));
set_attr(ist, OBJ(OBJECT), sym(ist, "Exception"), OBJ(EXCEPTION));
set_attr(ist, OBJ(OBJECT), sym(ist, "Object"), OBJ(OBJECT));
@@ -291,7 +291,7 @@
if (!proto) proto = OBJ(OBJECT);
obj->attr_proto.proto = proto;
lock_init(obj->wrlock);
- obj->del_locked = TRUE;
+ obj->del_locked = PR_TRUE;
pr_lock(&object_list_lock);
obj->next_obj = obj_list_root;
obj_list_root = obj;
@@ -365,11 +365,11 @@
ptr->attr.key = ENTRY_DELETED;
attr_alen(attrs)--;
write_unlock(ist, obj);
- return TRUE;
+ return PR_TRUE;
}
}
write_unlock(ist, obj);
- return FALSE;
+ return PR_FALSE;
}
//********************************* add_attrs *********************************
@@ -383,7 +383,7 @@
attr_bp(attrs,0)->attr.value = proto;
attr_alen(attrs) = 0;
obj->attr_proto.attrs = attrs;
- obj->has_attrs = TRUE;
+ obj->has_attrs = PR_TRUE;
return attrs;
}
@@ -469,7 +469,7 @@
for (i=0; i < len; i++)
if (attr_bp(attrs, i)->attr.value == proto) {
write_unlock(ist, obj);
- return FALSE;
+ return PR_FALSE;
}
if (len == attr_bsize(attrs)) {
attrs = attrs_realloc(obj, attrs);
@@ -478,13 +478,13 @@
if (pos >= len) {
attr_bp(attrs, attr_blen(attrs)++)->attr.value = proto;
write_unlock(ist, obj);
- return TRUE;
+ return PR_TRUE;
} else if (pos < 0) pos = 0;
memmove(attr_bp(attrs,pos+1),attr_bp(attrs,pos),(len-pos)*sizeof(attr_t));
attr_bp(attrs,pos)->attr.value = proto;
attr_blen(attrs)++;
write_unlock(ist, obj);
- return TRUE;
+ return PR_TRUE;
}
//********************************* del_proto **********************************
@@ -494,13 +494,13 @@
write_lock(ist, obj);
if (!obj->has_attrs) {
write_unlock(ist, obj);
- return FALSE;
+ return PR_FALSE;
}
attrs = obj->attr_proto.attrs;
len = attr_blen(attrs);
if (len < 2) {
write_unlock(ist, obj);
- return FALSE;
+ return PR_FALSE;
}
for (i=0; i < len; i++)
if (attr_bp(attrs, i)->attr.value == proto) {
@@ -508,10 +508,10 @@
memmove(attr_bp(attrs,i),attr_bp(attrs,i+1),((len-1)-i)*sizeof(attr_t));
attr_blen(attrs)--;
write_unlock(ist, obj);
- return TRUE;
+ return PR_TRUE;
}
write_unlock(ist, obj);
- return FALSE;
+ return PR_FALSE;
}
//********************************* proto_len **********************************
@@ -592,7 +592,7 @@
if ( (!obj->has_attrs && obj->attr_proto.proto == obj_proto) ||
obj_proto == OBJ(OBJECT) ) {
read_unlock(ist, obj);
- return TRUE;
+ return PR_TRUE;
}
pao_list = new_clist(10);
clist_append(pao_list, obj);
@@ -615,11 +615,11 @@
end_false:
clist_read_unlock(ist, pao_list);
pr_free(pao_list);
- return FALSE;
+ return PR_FALSE;
end_true:
clist_read_unlock(ist, pao_list);
pr_free(pao_list);
- return TRUE;
+ return PR_TRUE;
}
//********************************* get_proto_attr *****************************
@@ -630,7 +630,7 @@
int i, j, len;
clist_t *pao_list;
if (proto_pp) *proto_pp = NULL;
- while (TRUE){
+ while (PR_TRUE){
read_lock(ist, obj);
if( (res = get_attr(ist, obj, key)) || obj == OBJ(OBJECT) ) {
read_unlock(ist, obj);
@@ -754,7 +754,7 @@
obj->data_type = OBJ_TYPE_IMMDATA;
obj->imm_data_len = 8;
obj->data.i64 = num;
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
return obj;
}
@@ -764,7 +764,7 @@
obj->data_type = OBJ_TYPE_IMMDATA;
obj->imm_data_len = 8;
obj->data.f64 = num;
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
return obj;
}
@@ -787,7 +787,7 @@
obj_str->len = len;
strcpy(&(obj_str->str[0]), str);
}
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
return obj;
}
@@ -808,7 +808,7 @@
memcpy(&(obj_str->str[0]), str, len);
obj_str->str[len] = 0;
}
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
return obj;
}
@@ -819,7 +819,7 @@
hash_obj->imm_data_len = 4;
hash_obj->data.i32[0] = num & HASH_MASK;
if (!(hash_obj->data.i32[0])) hash_obj->data.i32[0] = 1;
- hash_obj->unmutable = TRUE;
+ hash_obj->unmutable = PR_TRUE;
return hash_obj;
}
@@ -931,7 +931,7 @@
list_append_no_lock(slice_obj,ind3);
}
}
- slice_obj->unmutable = TRUE;
+ slice_obj->unmutable = PR_TRUE;
return slice_obj;
}
@@ -940,7 +940,7 @@
obj_p super_obj = new_object(OBJ(SUPER_PROTO));
super_obj->data_type = OBJ_TYPE_DATAPTR;
super_obj->data.ptr = symbol;
- super_obj->unmutable = TRUE;
+ super_obj->unmutable = PR_TRUE;
return super_obj;
}
@@ -1073,12 +1073,12 @@
#define dict_wr_chk() \
if (ist->exception_obj) { \
write_unlock(ist, dict_obj); \
- return FALSE; \
+ return PR_FALSE; \
}
//********************************* dict_add **********************************
int dict_add(isp ist, obj_p dict_obj, obj_p key_in, obj_p value_in){
- i32_t i, hash, hash_in, match=FALSE;
+ i32_t i, hash, hash_in, match=PR_FALSE;
obj_p key, rp[2];
dict_p dict, dp, hole=NULL;
rp[0]=0; rp[1]=key_in;
@@ -1090,8 +1090,8 @@
hash = dp->entry.hash;
if (hash < 0) { hole = dp; continue; }
if ( hash == hash_in &&
- call_func(ist, key, SYM(__EQ__), 2, rp, NULL) == OBJ(TRUE) ) {
- match = TRUE;
+ call_func(ist, key, SYM(__EQ__), 2, rp, NULL) == OBJ(PR_TRUE) ) {
+ match = PR_TRUE;
break;
}
dict_wr_chk();
@@ -1135,7 +1135,7 @@
dict = (dict_p) obj_data_p(dict_obj);
for (i=hash_in; (key=((dp=dictptr(dict,i))->entry.key)); i++){
if ( dp->entry.hash == hash_in &&
- call_func(ist, key, SYM(__EQ__), 2, rp, NULL) == OBJ(TRUE) ) {
+ call_func(ist, key, SYM(__EQ__), 2, rp, NULL) == OBJ(PR_TRUE) ) {
dict_rd_chk();
res = dp->entry.value;
read_unlock(ist, dict_obj);
@@ -1195,7 +1195,7 @@
void dump(isp ist, char* dumfilename, obj_p obj){
fout = fopen(dumfilename, "w");
object_list = new_clist(10);
- first_symbol = TRUE;
+ first_symbol = PR_TRUE;
fprintf(fout,"\nDumping (%lx)\n",(unsigned long)(uintptr_t)obj);
fprintf(fout, "-------------------\n");
dump_obj(ist, obj, 0);
Modified: trunk/src/object.h
===================================================================
--- trunk/src/object.h 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/object.h 2004-03-27 00:49:13 UTC (rev 143)
@@ -119,7 +119,7 @@
extern pr_services_t dll_services;
// Use OBJ(OBJNAME) to access well-known object pointer
-// example: OBJ(OBJECT) or OBJ(TRUE)
+// example: OBJ(OBJECT) or OBJ(PR_TRUE)
#define OBJ(x) OBJ_[x]
// Use SYM(__XXX__) instead of sym(ist, "__xxx__") for speed.
Modified: trunk/src/parser_routines.c
===================================================================
--- trunk/src/parser_routines.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/parser_routines.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -88,9 +88,9 @@
state->in_buf = in_buf;
state->parse_results = NULL;
state->num_errors = -1;
- state->assert_enbld = TRUE;
- state->defdoc_flag = FALSE;
- state->eof_flag = FALSE;
+ state->assert_enbld = PR_TRUE;
+ state->defdoc_flag = PR_FALSE;
+ state->eof_flag = PR_FALSE;
state->const_objs = new_clist(10);
return state;
}
@@ -157,7 +157,7 @@
clist_append_num(p->srcmap, 0);
clist_append_num(p->srcmap, ((parse_state*) param)->line);
clist_append_num(p->srcmap, ((parse_state*) param)->column);
- p->doc_flg = FALSE;
+ p->doc_flg = PR_FALSE;
return debug_retrn(__LINE__, p);
}
@@ -191,12 +191,12 @@
//********************************* add_code_to *******************************
void add_code_to(code* newcode, code* res, int *k){
- add_code_flg(newcode, res, k, TRUE);
+ add_code_flg(newcode, res, k, PR_TRUE);
}
//********************************* add_code_no_free *******************************
void add_code_no_free(code* newcode, code* res, int *k){
- add_code_flg(newcode, res, k, FALSE);
+ add_code_flg(newcode, res, k, PR_FALSE);
}
//********************************* parser called routines ********************
@@ -219,7 +219,7 @@
stmt->stack_depth = 0;
stmt->max_stack_depth = 0;
stmt->code_data[0].bytecode.opcode = OP_NOP;
- stmt->doc_flg = TRUE;
+ stmt->doc_flg = PR_TRUE;
}
}
if (stmt->stack_depth) {
@@ -265,7 +265,7 @@
if (p1){
p1 = pr_realloc(p1, sizeof(code) + (p1->len + p3->len + size)*sizeof(code_t));
memcpy(p1->code_data + p1->len, p3->code_data, p3->len * sizeof(code_t));
- add_all_srcmap(p1, p3, p1->len, TRUE);
+ add_all_srcmap(p1, p3, p1->len, PR_TRUE);
p1->len += p3->len + size;
p1->max_stack_depth = max(p1->max_stack_depth, p1->stack_depth + p3->max_stack_depth);
p1->stack_depth = p1->stack_depth + p3->stack_depth;
@@ -563,7 +563,7 @@
res->code_data[k ].bytecode.opcode = OP_BEQ;
res->code_data[k++].bytecode.param = rparm->len+4;
res->code_data[k++].data =
- (andor_flg == OR_FLAG? OBJ(TRUE) : OBJ(FALSE));
+ (andor_flg == OR_FLAG? OBJ(PR_TRUE) : OBJ(PR_FALSE));
res->code_data[k ].bytecode.opcode = OP_POP;
res->code_data[k++].bytecode.param = 2;
add_code_to(rparm, res, &k);
@@ -582,7 +582,7 @@
res->code_data[(*k)++].bytecode.param = 0;
res->code_data[(*k) ].bytecode.opcode = OP_BEQ;
res->code_data[(*k)++].bytecode.param = body->len + 4;
- res->code_data[(*k)++].data = OBJ(FALSE);
+ res->code_data[(*k)++].data = OBJ(PR_FALSE);
res->code_data[(*k) ].bytecode.opcode = OP_POP;
res->code_data[(*k)++].bytecode.param = 1;
}
@@ -835,7 +835,7 @@
res->code_data[k ].bytecode.opcode = OP_BEQ;
res->code_data[k ].bytecode.param = els_loc - k;
k++;
- res->code_data[k++].data = OBJ(FALSE);
+ res->code_data[k++].data = OBJ(PR_FALSE);
res->code_data[k ].bytecode.opcode = OP_POP;
res->code_data[k++].bytecode.param = 1;
assert(body_loc == k);
@@ -874,7 +874,7 @@
res->code_data[k ].bytecode.opcode = OP_BEQ;
res->code_data[k ].bytecode.param = pop_loc - k;
k++;
- res->code_data[k++].data = OBJ(TRUE);
+ res->code_data[k++].data = OBJ(PR_TRUE);
res->code_data[k ].bytecode.opcode = OP_POP;
res->code_data[k++].bytecode.param = 1;
add_code_to(exc, res, &k);
@@ -1077,7 +1077,7 @@
memcpy(&(obj_str->str[0]), str, len);
obj_str->str[len] = 0;
}
- obj->unmutable = TRUE;
+ obj->unmutable = PR_TRUE;
p->code_data[0].bytecode.param = 2;
p->code_data[1].data = obj;
add_to_const_list(param, obj);
Modified: trunk/src/sys.c
===================================================================
--- trunk/src/sys.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/sys.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -124,7 +124,7 @@
}
obj_p load_sys_module(isp ist, char* prog_path, obj_p argv_obj) {
- int have_home = FALSE;
+ int have_home = PR_FALSE;
char *s, *d, path[1024], home[1024], *pp;
obj_p sys_path, vers_tuple;
obj_p sys_module;
@@ -145,7 +145,7 @@
if ((pp = getenv("PROTHONPATH"))) {
s=pp;
- while(TRUE) {
+ while(PR_TRUE) {
for (d=path; *s && *s!=';'; s++, d++) *d = *s;
*d = 0;
add_path(ist, sys_path, path); if_exc_return NULL;
@@ -162,7 +162,7 @@
if (path[len-1] == '\\')
path[len-1] = 0;
strcpy(home, path);
- have_home = TRUE;
+ have_home = PR_TRUE;
set_attr(ist, sys_module, sym(ist, "prothonhome"), new_string_obj(home));
}
}
@@ -173,14 +173,14 @@
getcwd(path, sizeof(path));
#endif
strcpy(home, path);
- have_home = TRUE;
+ have_home = PR_TRUE;
set_attr(ist, sys_module, sym(ist, "prothonhome"), new_string_obj(home));
}
vers_tuple = new_tuple_obj(3);
list_append(ist, vers_tuple, new_string_obj(PROTHON_VERSION_NUMBER));
list_append(ist, vers_tuple, new_string_obj(numonly(PROTHON_VERSION_BUILD, path)));
list_append(ist, vers_tuple, new_string_obj(PROTHON_VERSION_DATE));
- vers_tuple->unmutable = TRUE;
+ vers_tuple->unmutable = PR_TRUE;
set_attr(ist, sys_module, sym(ist, "version"), vers_tuple);
set_attr(ist, sys_module, sym(ist, "maxint"), new_int_obj(MAX_INT_VAL));
set_attr(ist, sys_module, sym(ist, "modules"), OBJ(MODULES));
Modified: trunk/src/thread.c
===================================================================
--- trunk/src/thread.c 2004-03-27 00:37:31 UTC (rev 142)
+++ trunk/src/thread.c 2004-03-27 00:49:13 UTC (rev 143)
@@ -91,13 +91,13 @@
}
while (*((int*)thread_number_ptr)) {
int size = attr_tsize(obj->attr_proto.attrs)+(rand() & 31);
- int obj_locked = TRUE;
+ int obj_locked = PR_TRUE;
if (obj->has_attrs)
obj->attr_proto.attrs = pr_realloc( obj->attr_proto.attrs,
size * sizeof(attr_t) );
- while(TRUE) {
+ while(PR_TRUE) {
pr_lock(&object_list_lock);
- if (obj_locked) {write_unlock(ist, obj); obj_locked = FALSE;}
+ if (obj_locked) {write_unlock(ist, obj); obj_locked = PR_FALSE;}
do {obj = obj->next_obj;} while (obj && !write_lock_try(ist, obj));
if (obj) break;
pr_unlock(&object_list_lock);