diff -cr v22pre10/src/ChangeLog.beta v22pre11/src/ChangeLog.beta *** v22pre10/src/ChangeLog.beta Tue Aug 12 22:32:51 1997 --- v22pre11/src/ChangeLog.beta Wed Sep 24 19:06:02 1997 *************** *** 1,4 **** --- 1,12 ---- ---------------------------------------------------------------------------- + Sat Aug 30 19:24:51 EDT 1997 (tim@wfn-shop.princeton.edu (Beek)) + * raised patchlevel to v22pre11 + * fixed ed_start() with no args to set the type of its return value + [fix from Jalh@LimaBean] + * fixed 'buffer[i] = 0' to work again + * fixed save_object() to save '0.000' as a float and not as int '0' + [reported by Descartes; patch from Aragorn] + Wed Jul 23 17:39:48 EDT 1997 (tim@wfn-shop.princeton.edu (Beek)) * raised patchlevel to v22pre10 * added workaround for Ultrix sh bug (returns error code on if diff -cr v22pre10/src/Makefile.master v22pre11/src/Makefile.master *** v22pre10/src/Makefile.master Tue Aug 12 18:49:06 1997 --- v22pre11/src/Makefile.master Wed Sep 3 11:34:27 1997 *************** *** 261,266 **** --- 261,267 ---- spotless: clean -rm -f configure.h local_options system_libs configuration -rm -f options_incl.h + -rm -f *.diffs # get ready for recompile neat: diff -cr v22pre10/src/efuns_main.c v22pre11/src/efuns_main.c *** v22pre10/src/efuns_main.c Sat Jul 26 23:06:04 1997 --- v22pre11/src/efuns_main.c Sat Sep 6 11:28:30 1997 *************** *** 736,742 **** res = object_ed_start(current_object, fname, restr); if (fname) free_string_svalue(sp); ! else ++sp; if (res) { sp->subtype = STRING_MALLOC; --- 736,745 ---- res = object_ed_start(current_object, fname, restr); if (fname) free_string_svalue(sp); ! else { ! ++sp; ! sp->type = T_STRING; ! } if (res) { sp->subtype = STRING_MALLOC; diff -cr v22pre10/src/interpret.c v22pre11/src/interpret.c *** v22pre10/src/interpret.c Wed Jul 23 17:27:09 1997 --- v22pre11/src/interpret.c Wed Sep 24 19:02:34 1997 *************** *** 601,606 **** --- 601,607 ---- unlink_string_svalue(lv); sp->type = T_LVALUE; sp->u.lvalue = &global_lvalue_byte; + global_lvalue_byte.subtype = 0; global_lvalue_byte.u.lvalue_byte = (unsigned char *)&lv->u.string[ind]; break; } *************** *** 612,617 **** --- 613,619 ---- error("Buffer index out of bounds.\n"); sp->type = T_LVALUE; sp->u.lvalue = &global_lvalue_byte; + global_lvalue_byte.subtype = 1; global_lvalue_byte.u.lvalue_byte = &lv->u.buf->item[ind]; break; } *************** *** 666,671 **** --- 668,674 ---- sp->u.buf->ref--; (--sp)->type = T_LVALUE; sp->u.lvalue = &global_lvalue_byte; + global_lvalue_byte.subtype = 1; global_lvalue_byte.u.lvalue_byte = (sp+1)->u.buf->item + ind; break; } *************** *** 1871,1877 **** lval->u.real++; break; case T_LVALUE_BYTE: ! if (*global_lvalue_byte.u.lvalue_byte == (unsigned char)255) error("Strings cannot contain 0 bytes.\n"); ++*global_lvalue_byte.u.lvalue_byte; break; --- 1874,1881 ---- lval->u.real++; break; case T_LVALUE_BYTE: ! if (global_lvalue_byte.subtype == 0 && ! *global_lvalue_byte.u.lvalue_byte == (unsigned char)255) error("Strings cannot contain 0 bytes.\n"); ++*global_lvalue_byte.u.lvalue_byte; break; *************** *** 2337,2343 **** c = *global_lvalue_byte.u.lvalue_byte + sp->u.number; ! if (c == '\0') error("Strings cannot contain 0 bytes.\n"); *global_lvalue_byte.u.lvalue_byte = c; } --- 2341,2347 ---- c = *global_lvalue_byte.u.lvalue_byte + sp->u.number; ! if (global_lvalue_byte.subtype == 0 && c == '\0') error("Strings cannot contain 0 bytes.\n"); *global_lvalue_byte.u.lvalue_byte = c; } *************** *** 2556,2562 **** error("Illegal rhs to char lvalue\n"); } else { c = ((sp - 1)->u.number & 0xff); ! if (c == '\0') error("Strings cannot contain 0 bytes.\n"); *global_lvalue_byte.u.lvalue_byte = c; } --- 2560,2566 ---- error("Illegal rhs to char lvalue\n"); } else { c = ((sp - 1)->u.number & 0xff); ! if (global_lvalue_byte.subtype == 0 && c == '\0') error("Strings cannot contain 0 bytes.\n"); *global_lvalue_byte.u.lvalue_byte = c; } *************** *** 2595,2601 **** error("Illegal rhs to char lvalue\n"); } else { char c = (sp--)->u.number & 0xff; ! if (c == '\0') error("Strings cannot contain 0 bytes.\n"); *global_lvalue_byte.u.lvalue_byte = c; } --- 2599,2605 ---- error("Illegal rhs to char lvalue\n"); } else { char c = (sp--)->u.number & 0xff; ! if (global_lvalue_byte.subtype == 0 && c == '\0') error("Strings cannot contain 0 bytes.\n"); *global_lvalue_byte.u.lvalue_byte = c; } *************** *** 2729,2735 **** sp->u.real = --(lval->u.real); break; case T_LVALUE_BYTE: ! if (*global_lvalue_byte.u.lvalue_byte == '\x1') error("Strings cannot contain 0 bytes.\n"); sp->type = T_NUMBER; sp->subtype = 0; --- 2733,2740 ---- sp->u.real = --(lval->u.real); break; case T_LVALUE_BYTE: ! if (global_lvalue_byte.subtype == 0 && ! *global_lvalue_byte.u.lvalue_byte == '\x1') error("Strings cannot contain 0 bytes.\n"); sp->type = T_NUMBER; sp->subtype = 0; *************** *** 2751,2757 **** lval->u.real--; break; case T_LVALUE_BYTE: ! if (*global_lvalue_byte.u.lvalue_byte == '\x1') error("Strings cannot contain 0 bytes.\n"); --(*global_lvalue_byte.u.lvalue_byte); break; --- 2756,2763 ---- lval->u.real--; break; case T_LVALUE_BYTE: ! if (global_lvalue_byte.subtype == 0 && ! *global_lvalue_byte.u.lvalue_byte == '\x1') error("Strings cannot contain 0 bytes.\n"); --(*global_lvalue_byte.u.lvalue_byte); break; *************** *** 2845,2851 **** sp->u.real = ++lval->u.number; break; case T_LVALUE_BYTE: ! if (*global_lvalue_byte.u.lvalue_byte == (unsigned char)255) error("Strings cannot contain 0 bytes.\n"); sp->type = T_NUMBER; sp->subtype = 0; --- 2851,2858 ---- sp->u.real = ++lval->u.number; break; case T_LVALUE_BYTE: ! if (global_lvalue_byte.subtype == 0 && ! *global_lvalue_byte.u.lvalue_byte == (unsigned char)255) error("Strings cannot contain 0 bytes.\n"); sp->type = T_NUMBER; sp->subtype = 0; *************** *** 3165,3171 **** break; case T_LVALUE_BYTE: sp->type = T_NUMBER; ! if (*global_lvalue_byte.u.lvalue_byte == '\x1') error("Strings cannot contain 0 bytes.\n"); sp->u.number = (*global_lvalue_byte.u.lvalue_byte)--; break; --- 3172,3179 ---- break; case T_LVALUE_BYTE: sp->type = T_NUMBER; ! if (global_lvalue_byte.subtype == 0 && ! *global_lvalue_byte.u.lvalue_byte == '\x1') error("Strings cannot contain 0 bytes.\n"); sp->u.number = (*global_lvalue_byte.u.lvalue_byte)--; break; *************** *** 3188,3194 **** sp->u.real = lval->u.real++; break; case T_LVALUE_BYTE: ! if (*global_lvalue_byte.u.lvalue_byte == (unsigned char)255) error("Strings cannot contain 0 bytes.\n"); sp->type = T_NUMBER; sp->u.number = (*global_lvalue_byte.u.lvalue_byte)++; --- 3196,3203 ---- sp->u.real = lval->u.real++; break; case T_LVALUE_BYTE: ! if (global_lvalue_byte.subtype == 0 && ! *global_lvalue_byte.u.lvalue_byte == (unsigned char)255) error("Strings cannot contain 0 bytes.\n"); sp->type = T_NUMBER; sp->u.number = (*global_lvalue_byte.u.lvalue_byte)++; diff -cr v22pre10/src/object.c v22pre11/src/object.c *** v22pre10/src/object.c Wed Jul 23 17:27:31 1997 --- v22pre11/src/object.c Wed Sep 24 19:04:40 1997 *************** *** 112,118 **** case T_REAL: { char buf[256]; ! sprintf(buf, "%g", v->u.real); return (int)(strlen(buf)+1); } --- 112,118 ---- case T_REAL: { char buf[256]; ! sprintf(buf, "%#g", v->u.real); return (int)(strlen(buf)+1); } *************** *** 198,204 **** case T_REAL: { ! sprintf(*buf, "%g", v->u.real); (*buf) += strlen(*buf); return; } --- 198,204 ---- case T_REAL: { ! sprintf(*buf, "%#g", v->u.real); (*buf) += strlen(*buf); return; } diff -cr v22pre10/src/options.h v22pre11/src/options.h *** v22pre10/src/options.h Wed Jul 23 17:27:33 1997 --- v22pre11/src/options.h Tue Sep 16 23:25:05 1997 *************** *** 112,117 **** --- 112,125 ---- * The MudOS driver has evolved quite a bit over the years. These defines * * are mainly to preserve old behavior in case people didn't want to * * rewrite the relevant portions of their code. * + * * + * In most cases, code which needs these defines should be rewritten when * + * possible. The 'Compat status' field is designed to give an idea how * + * likely it is that support for that option will be removed in the near * + * future. Certain options are fairly easy to work around, and double * + * the size of the associated code, as well as the maintenance workload, * + * and can make the code significantly more complex or harder to read, so * + * supporting them indefinitely is impractical. * * * * WARNING: If you are using software designed to run with the MudOS driver * * it may assume certain settings of these options. Check the * *************** *** 120,125 **** --- 128,135 ---- /* HAS_STATUS_TYPE: old MudOS drivers had a 'status' type which was * identical to the 'int' type. Define this to bring it back. + * + * Compat status: very archaic, but easy to support. */ #undef HAS_STATUS_TYPE *************** *** 137,148 **** * it so that implode(explode(x, y), y) is always x; i.e. no delimiters * are every stripped. So the example above gives * ({ "", "", "x", "y", "", "z", "", "" }). */ #define SANE_EXPLODE_STRING #undef REVERSIBLE_EXPLODE_STRING ! /* CAST_CALL_OTHERS: define this if you want to require casting of call_other's; * this was the default behavior of the driver prior to this addition. */ #undef CAST_CALL_OTHERS --- 147,164 ---- * it so that implode(explode(x, y), y) is always x; i.e. no delimiters * are every stripped. So the example above gives * ({ "", "", "x", "y", "", "z", "", "" }). + * + * Compat status: which of these is "correct" is a religious question + * anyway, despite how ugly it makes the explode() code. */ #define SANE_EXPLODE_STRING #undef REVERSIBLE_EXPLODE_STRING ! /* CAST_CALL_OTHERS: define this if you want to require casting of call_others; * this was the default behavior of the driver prior to this addition. + * + * Compat status: code that requires it doesn't break, and it promotes + * sloppy coding with no benefits. */ #undef CAST_CALL_OTHERS *************** *** 149,177 **** /* NONINTERACTIVE_STDERR_WRITE: if defined, all writes/tells/etc to * noninteractive objects will be written to stderr prefixed with a ']' * (old behavior). */ #define NONINTERACTIVE_STDERR_WRITE /* NO_LIGHT: define this to disable the set_light() and driver maintenance * of light levels in objects. You can simulate it via LPC if you want... */ #define NO_LIGHT /* NO_ADD_ACTION: define this to remove add_action, commands, livings, etc. ! process_input() then becomes the only way to deal with player input. */ #undef NO_ADD_ACTION /* NO_ENVIRONMENT: define this to remove the handling of object containment ! relationships by the driver */ #undef NO_ENVIRONMENT /* NO_WIZARDS: for historical reasons, MudOS used to keep track of who ! is and isn't a wizard. Defining this removes that completely. ! If this is defined, the wizardp() and related efuns don't exist */ #define NO_WIZARDS /* OLD_TYPE_BEHAVIOR: reintroduces a bug in type-checking that effectively * renders compile time type checking useless. For backwards compatibility. */ #undef OLD_TYPE_BEHAVIOR --- 165,216 ---- /* NONINTERACTIVE_STDERR_WRITE: if defined, all writes/tells/etc to * noninteractive objects will be written to stderr prefixed with a ']' * (old behavior). + * + * Compat status: Easy to support, and also on the "It's a bug! No, it's + * a feature!" religious war list. */ #define NONINTERACTIVE_STDERR_WRITE /* NO_LIGHT: define this to disable the set_light() and driver maintenance * of light levels in objects. You can simulate it via LPC if you want... + * + * Compat status: Very dated, easy to simulate, and gross. */ #define NO_LIGHT /* NO_ADD_ACTION: define this to remove add_action, commands, livings, etc. ! * process_input() then becomes the only way to deal with player input. ! * ! * Compat status: next to impossible to simulate, hard to replace, and ! * very, very widely used. ! */ #undef NO_ADD_ACTION /* NO_ENVIRONMENT: define this to remove the handling of object containment ! * relationships by the driver ! * ! * Compat status: hard to simulate efficiently, and very widely used. ! */ #undef NO_ENVIRONMENT /* NO_WIZARDS: for historical reasons, MudOS used to keep track of who ! * is and isn't a wizard. Defining this removes that completely. ! * If this is defined, the wizardp() and related efuns don't exist. ! * ! * Also note that if it is not defined, then non-wizards are always put ! * in restricted mode when ed() is used, regardless of the setting of ! * the restrict parameter. ! * ! * Compat status: easy to simulate and dated. ! */ #define NO_WIZARDS /* OLD_TYPE_BEHAVIOR: reintroduces a bug in type-checking that effectively * renders compile time type checking useless. For backwards compatibility. + * + * Compat status: dealing with all the resulting compile errors can be + * a huge pain even if they are correct, and the impact on the code is + * small. */ #undef OLD_TYPE_BEHAVIOR *************** *** 179,192 **** --- 218,244 ---- * or buffer range values (not lvalue, i.e. x[-2..-1]; for e.g. not * x[-2..-1] = foo, the latter is always illegal) to mean counting from the * end + * + * Compat status: Not horribly difficult to replace reliance on this, but not + * trivial, and cannot be simulated. */ #undef OLD_RANGE_BEHAVIOR /* OLD_ED: ed() efun backwards compatible with the old version. The new * version requires/allows a mudlib front end. + * + * Compat status: Easily simulated. */ #define OLD_ED + /* COMPRESS_FUNCTION_TABLES: Causes function tables to take up significantly + * less memory, at the cost of a slight increase in function call overhead + * (speed). + * + * Compat status: The speed cost is almost neglible. + */ + #define COMPRESS_FUNCTION_TABLES + /**************************************************************************** * MISCELLANEOUS * * --------------- * *************** *** 327,338 **** * reloaded that otherwise would). */ #undef LAZY_RESETS - - /* COMPRESS_FUNCTION_TABLES: Causes function tables to take up significantly - * less memory, at the cost of a slight increase in function call overhead - * (speed). - */ - #define COMPRESS_FUNCTION_TABLES /* SAVE_EXTENSION: defines the file extension used by save_object(). * and restore_object(). Some sysadmins run scripts that periodically --- 379,384 ---- diff -cr v22pre10/src/patchlevel.h v22pre11/src/patchlevel.h *** v22pre10/src/patchlevel.h Sat Aug 30 19:01:48 1997 --- v22pre11/src/patchlevel.h Wed Sep 24 22:52:42 1997 *************** *** 1 **** ! #define PATCH_LEVEL "v22pre10" --- 1 ---- ! #define PATCH_LEVEL "v22pre11"