Files
ports/lang/ficl/files/patch-primitives.c
T
Raphael Kubo da Costa 26372dce2a Bring in some fixes from GSoC 2015.
There was a GSoC 2015 from Colin Lord to bring to the base system a recent
version of Ficl. pfg@ found many bugs in ficl4.

Among them:
- Fix ficlInstructionPick bug. Pick instructions from 0, not 1.
Credit to Toomas Soome from the Illumos project.
- Fix some math bugs.
Credit to Toomas Soome from the Illumos project.
- Fix bug in Ficl stack preventing the stack from growing.
Obtained from:    http://sourceforge.net/p/ficl/mailman/message/26634755/
- Change rand and srand calls to random and srandom

Fix those in the port. While here, unset MAKE_JOBS_UNSAFE as the port builds
fine without it, and get rid of the DATA option that has no effect.

PR:		207041
Submitted by:	pfg
Approved by:	Pavel Volkov <pavelivolkov@gmail.com> (maintainer)
2016-03-05 19:07:33 +00:00

21 lines
685 B
C

--- primitives.c.orig 2010-09-13 18:43:04 UTC
+++ primitives.c
@@ -487,7 +487,7 @@ static void ficlPrimitiveSprintf(ficlVm
ficlStackPushPointer(vm->dataStack, bufferStart);
ficlStackPushInteger(vm->dataStack, buffer - bufferStart);
- ficlStackPushInteger(vm->dataStack, append && FICL_TRUE);
+ ficlStackPushInteger(vm->dataStack, FICL_BOOL(!append));
}
@@ -1350,7 +1350,7 @@ static void ficlPrimitiveSetObjectFlag(f
static void ficlPrimitiveIsObject(ficlVm *vm)
{
- int flag;
+ ficlInteger flag;
ficlWord *word = (ficlWord *)ficlStackPopPointer(vm->dataStack);
flag = ((word != NULL) && (word->flags & FICL_WORD_OBJECT)) ? FICL_TRUE : FICL_FALSE;