X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=nucleus%2Flibrary%2Fbasis%2Fastring.cpp;h=3fdf4437d5ac93555f292c1a05a1de646b2f03b8;hb=6f4f86051d7e4ad4755152503098bbb3888e4aad;hp=3c09fce8f1c30efac4565011823bc03923d810ee;hpb=24b2947ed9364f3e83fa1bb544ff6b1fdbf0428f;p=feisty_meow.git diff --git a/nucleus/library/basis/astring.cpp b/nucleus/library/basis/astring.cpp index 3c09fce8..3fdf4437 100644 --- a/nucleus/library/basis/astring.cpp +++ b/nucleus/library/basis/astring.cpp @@ -19,12 +19,14 @@ #include #include -//#ifdef __WIN32__ -// #undef strcasecmp -// #undef strncasecmp -// #define strcasecmp strcmpi -// #define strncasecmp strnicmp -//#endif +/* +#ifdef _MSC_VER + #undef strcasecmp + #undef strncasecmp + #define strcasecmp strcmpi + #define strncasecmp strnicmp +#endif +*/ //#define DEBUG_STRING // uncomment for debugging version. @@ -69,7 +71,11 @@ astring::astring(char initial, int repeat) { if (!initial) initial = ' '; // for nulls, we use spaces. int new_size = c_character_manager.length() - 1; - memset(c_character_manager.access(), initial, new_size); + + /*hmmm: eclipse was badgering me into adding types on this, but it's not really an error in my code seemingly. + * eclipse seems to want a ? type in the last parameter, not a size_t or int. why? doesn't it know size_t? + */ + memset((void *)c_character_manager.access(), (int)initial, (size_t)new_size); c_character_manager.put(new_size, '\0'); c_held_string = (char * const *)c_character_manager.internal_offset_mem(); } @@ -117,7 +123,7 @@ astring::astring(special_flag flag, const char *initial, ...) va_end(args); } -astring::~astring() { c_held_string = NIL; } +astring::~astring() { c_held_string = NULL_POINTER; } const astring &astring::empty_string() { return bogonic(); } @@ -415,7 +421,7 @@ void astring::get_type_character(const char * &traverser, va_list &args, } // action time: the output string is given a tasty value. char temp[LONGEST_SPRINTF]; - char *temp2 = NIL; // for dynamic only. + char *temp2 = NULL_POINTER; // for dynamic only. switch (next_argument) { //hmmm: this switch is where support would need to be added for having two // arguments (for the '*' case). @@ -431,7 +437,7 @@ void astring::get_type_character(const char * &traverser, va_list &args, if (!to_print) { // bogus string; put in a complaint. use_dynamic_sprintf = false; - ::sprintf(temp, "{error:parm=NIL}"); + ::sprintf(temp, "{error:parm=NULL_POINTER}"); } else if (strlen(to_print) < LONGEST_SPRINTF - 2) { // we're within our bounds, plus some safety room, so just do a // regular sprintf. @@ -552,7 +558,7 @@ void astring::copy(char *array_to_stuff, int how_many) const if (!array_to_stuff) return; array_to_stuff[0] = '\0'; if ( (how_many <= 0) || (length() <= 0) ) return; - strncpy(array_to_stuff, observe(), minimum(how_many, int(length()))); + strncpy(array_to_stuff, observe(), (size_t)minimum(how_many, int(length()))); array_to_stuff[minimum(how_many, int(length()))] = '\0'; }