words.c (42209) | words.c (42634) |
---|---|
1/******************************************************************* 2** w o r d s . c 3** Forth Inspired Command Language 4** ANS Forth CORE word-set written in C 5** Author: John Sadler (john_sadler@alum.mit.edu) 6** Created: 19 July 1997 7** 8*******************************************************************/ --- 2744 unchanged lines hidden (view full) --- 2753 UNS32 count = stackPopUNS32(pVM->pStack); 2754 char *cp = stackPopPtr(pVM->pStack); 2755 2756 /* 2757 ** Since we don't have an output primitive for a counted string 2758 ** (oops), make sure the string is null terminated. If not, copy 2759 ** and terminate it. 2760 */ | 1/******************************************************************* 2** w o r d s . c 3** Forth Inspired Command Language 4** ANS Forth CORE word-set written in C 5** Author: John Sadler (john_sadler@alum.mit.edu) 6** Created: 19 July 1997 7** 8*******************************************************************/ --- 2744 unchanged lines hidden (view full) --- 2753 UNS32 count = stackPopUNS32(pVM->pStack); 2754 char *cp = stackPopPtr(pVM->pStack); 2755 2756 /* 2757 ** Since we don't have an output primitive for a counted string 2758 ** (oops), make sure the string is null terminated. If not, copy 2759 ** and terminate it. 2760 */ |
2761 /* XXX Uses free space on top of dictionary. Is it guaranteed 2762 * XXX to always fit? (abial) 2763 */ |
|
2761 if (cp[count] != '\0') 2762 { 2763 char *pDest = (char *)ficlGetDict()->here; 2764 if (cp != pDest) 2765 strncpy(pDest, cp, count); 2766 2767 pDest[count] = '\0'; 2768 cp = pDest; --- 1608 unchanged lines hidden (view full) --- 4377 dictAppendWord(dp, "fclose", pfclose, FW_DEFAULT); 4378 dictAppendWord(dp, "fread", pfread, FW_DEFAULT); 4379 dictAppendWord(dp, "fload", pfload, FW_DEFAULT); 4380 dictAppendWord(dp, "fkey", fkey, FW_DEFAULT); 4381 dictAppendWord(dp, "key", key, FW_DEFAULT); 4382 dictAppendWord(dp, "key?", keyQuestion, FW_DEFAULT); 4383 dictAppendWord(dp, "ms", ms, FW_DEFAULT); 4384 dictAppendWord(dp, "seconds", pseconds, FW_DEFAULT); | 2764 if (cp[count] != '\0') 2765 { 2766 char *pDest = (char *)ficlGetDict()->here; 2767 if (cp != pDest) 2768 strncpy(pDest, cp, count); 2769 2770 pDest[count] = '\0'; 2771 cp = pDest; --- 1608 unchanged lines hidden (view full) --- 4380 dictAppendWord(dp, "fclose", pfclose, FW_DEFAULT); 4381 dictAppendWord(dp, "fread", pfread, FW_DEFAULT); 4382 dictAppendWord(dp, "fload", pfload, FW_DEFAULT); 4383 dictAppendWord(dp, "fkey", fkey, FW_DEFAULT); 4384 dictAppendWord(dp, "key", key, FW_DEFAULT); 4385 dictAppendWord(dp, "key?", keyQuestion, FW_DEFAULT); 4386 dictAppendWord(dp, "ms", ms, FW_DEFAULT); 4387 dictAppendWord(dp, "seconds", pseconds, FW_DEFAULT); |
4388#ifdef __i386__ 4389 dictAppendWord(dp, "pc!", pc_store, FW_DEFAULT); 4390 dictAppendWord(dp, "pc@", pc_fetch, FW_DEFAULT); 4391 ficlSetEnv("arch-i386", FICL_TRUE); 4392#else 4393 ficlSetEnv("arch-i386", FICL_FALSE); 4394#endif |
|
4385 4386 /* 4387 ** Set CORE environment query values 4388 */ 4389 ficlSetEnv("/counted-string", FICL_STRING_MAX); 4390 ficlSetEnv("/hold", nPAD); 4391 ficlSetEnv("/pad", nPAD); 4392 ficlSetEnv("address-unit-bits", 8); --- 140 unchanged lines hidden --- | 4395 4396 /* 4397 ** Set CORE environment query values 4398 */ 4399 ficlSetEnv("/counted-string", FICL_STRING_MAX); 4400 ficlSetEnv("/hold", nPAD); 4401 ficlSetEnv("/pad", nPAD); 4402 ficlSetEnv("address-unit-bits", 8); --- 140 unchanged lines hidden --- |