]> git.pond.sub.org Git - empserver/blobdiff - src/lib/common/nstreval.c
Update copyright notice
[empserver] / src / lib / common / nstreval.c
index 10a44110f8bf60d4c8689f7ff3828ab5fe9071c5..b7663d81e9737a01c4433ec995b9b45ffff1c402 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2009, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
  *  ---
  *
  *  nstreval.c: evaluate compiled values
- * 
+ *
  *  Known contributors to this file:
  *     Dave Pare, 1989
  *     Steve McClure, 1997
@@ -66,8 +66,7 @@ nstr_mksymval(struct valstr *val, struct castr *ca, int idx)
  * PTR points to a context object of the type that was used to compile
  * the value.
  * Unless WANT is NSC_NOTYPE, coerce the value to promoted value type
- * WANT.  VAL must be coercible.  That's the case if a previous
- * nstr_coerce_val(VAL, WANT, STR) succeeded.
+ * WANT.  VAL must be coercible.
  */
 struct valstr *
 nstr_exec_val(struct valstr *val, natid cnum, void *ptr, enum nsc_type want)
@@ -186,6 +185,7 @@ nstr_exec_val(struct valstr *val, natid cnum, void *ptr, enum nsc_type want)
        valtype = NSC_NOTYPE;
     }
 
+    /* coerce */
     if (valtype == want)
        ;
     else if (want == NSC_DOUBLE) {
@@ -193,8 +193,7 @@ nstr_exec_val(struct valstr *val, natid cnum, void *ptr, enum nsc_type want)
            valtype = want;
            val->val_as.dbl = val->val_as.lng;
        }
-    } else if (want == NSC_STRING)
-       CANT_REACH();           /* FIXME implement */
+    }
 
     if (CANT_HAPPEN(valtype != want && want != NSC_NOTYPE)) {
        /* make up an error value */