ChangeLogTag:Thu May 06 13:09:45 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>

This commit is contained in:
Gonzalo A. Diethelm
1999-05-06 18:27:47 +00:00
parent 5c5490e33a
commit 2592cb0111
13 changed files with 82 additions and 55 deletions

View File

@@ -1,3 +1,33 @@
Thu May 06 13:09:45 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
* config/bin.cf:
* config/c.cf:
* config/lib.cf:
* config/prg.cf:
* config/test.cf:
* source/rtl/Makefile:
By mistake, we were not compiling the PRG files into OBJS for the
rtl library.
* source/rtl/dates.c:
Changed the use of min with explicit code. min and max are macros
in some platforms, functions in others, and it is usually a mess
to link against them.
* source/Makefile:
* source/tools/Makefile:
This directory was not being compiled.
* source/tools/genobj.c:
Got rid of most (all?) the warnings.
* tests/working/Makefile:
Now the libs to link against are explicitly specified in the
Makefile.
* tests/working/statics.prg:
Cleaned up all ^M characters.
Thu May 06 12:34:45 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
* source/compiler/harbour.l:

View File

@@ -2,11 +2,14 @@
# $Id$
#
include $(TOP)$(ROOT)config/global.cf
include $(TOP)$(ROOT)config/c.cf
EXE_NAME = $(C_MAIN:.c=$(EXE_EXT))
EXE_ARCH = $(ARCH_DIR)$(EXE_NAME)
ALL_OBJS = $(ALL_C_OBJS) $(ALL_PRG_OBJS)
first : dirbase descend
descend :

View File

@@ -2,8 +2,6 @@
# $Id$
#
include $(TOP)$(ROOT)config/global.cf
C_OBJS = $(C_SOURCES:.c=$(OBJ_EXT))
MAIN_OBJ = $(C_MAIN:.c=$(OBJ_EXT))
@@ -21,7 +19,7 @@ LEX_C = $(shell echo $(LEX_SOURCE) | cut -c1-4)_l.c
LEX_OBJ = $(LEX_C:.c=$(OBJ_EXT))
endif
ALL_OBJS = $(C_OBJS) $(MAIN_OBJ) $(YACC_OBJ) $(LEX_OBJ)
ALL_C_OBJS = $(C_OBJS) $(MAIN_OBJ) $(YACC_OBJ) $(LEX_OBJ)
$(YACC_OBJ) : $(YACC_C)

View File

@@ -2,11 +2,15 @@
# $Id$
#
include $(TOP)$(ROOT)config/global.cf
include $(TOP)$(ROOT)config/c.cf
include $(TOP)$(ROOT)config/prg.cf
LIB_NAME = $(LIB_PREF)$(LIB)$(LIB_EXT)
LIB_ARCH = $(ARCH_DIR)$(LIB_NAME)
ALL_OBJS = $(ALL_C_OBJS) $(ALL_PRG_OBJS)
first : dirbase descend
descend :

View File

@@ -2,17 +2,14 @@
# $Id$
#
LIBS += vm rtl
include $(TOP)$(ROOT)config/global.cf
C_SOURCES = $(PRG_SOURCES:.prg=.c)
PRG_C_SOURCES = $(PRG_SOURCES:.prg=.c)
PRG_OBJS = $(PRG_SOURCES:.prg=$(OBJ_EXT))
PRG_EXES = $(PRG_SOURCES:.prg=$(EXE_EXT))
ALL_PRG_OBJS = $(PRG_OBJS)
$(PRG_EXES) : %$(EXE_EXT) : %$(OBJ_EXT)
$(PRG_OBJS) : %$(OBJ_EXT) : %.c
$(C_SOURCES) : %.c : ../../%.prg
$(PRG_C_SOURCES) : %.c : ../../%.prg

View File

@@ -2,6 +2,7 @@
# $Id$
#
include $(TOP)$(ROOT)config/global.cf
include $(TOP)$(ROOT)config/prg.cf
first : dirbase descend

View File

@@ -8,5 +8,6 @@ DIRS=\
compiler \
rtl \
vm \
tools \
include $(ROOT)config/dir.cf

View File

@@ -21,6 +21,11 @@ C_SOURCES=\
strings.c \
transfrm.c \
PRG_SOURCES=\
error.prg \
errorsys.prg \
tclass.prg \
LIB=rtl
include $(TOP)$(ROOT)config/lib.cf

View File

@@ -122,7 +122,9 @@ char * hb_dtoc (char * szDate, char * szDateFormat)
/*
* Determine the maximum size of the formatted date string
*/
size = min (10, strlen (hb_set.HB_SET_DATEFORMAT));
size = strlen (hb_set.HB_SET_DATEFORMAT);
if (size > 10)
size = 10;
format_count = 0;
used_d = used_m = used_y = FALSE;

View File

@@ -0,0 +1,18 @@
#
# $Id$
#
ROOT = ../../
C_SOURCES=\
datesx.c \
debug.c \
genobj.c \
mathx.c \
stringsx.c \
# io.c should be in the list, but it is DOS-specific.
LIB=tools
include $(TOP)$(ROOT)config/lib.cf

View File

@@ -10,6 +10,10 @@
#include <string.h>
#include <types.h>
#if defined(__GNUC__) || defined(__DJGPP__)
#include <unistd.h>
#endif
void CompiledFileName( int hObjFile, char * szFileName );
void CompilerVersion( int hObjFile, char * szFileName );
void LocalNames( int hObjFile, char * szNames[] );
@@ -47,7 +51,7 @@ int main( int argc, char * argv[] )
3, /* "CODE" position + 1 into localNames */
0x3D ); /* segment length */
PubDef( hObjFile, "MAIN", 1, 0x10 ); /* 1 = _TEXT segment, 0x10 offset into it );
PubDef( hObjFile, "MAIN", 1, 0x10 ); /* 1 = _TEXT segment, 0x10 offset into it ); */
/* data segment */
DefineSegment( hObjFile, 4, /* "_DATA" position + 1 into localNames */
@@ -82,6 +86,7 @@ int main( int argc, char * argv[] )
End( hObjFile );
close( hObjFile );
return 0;
}
void putbyte( BYTE b, int hObjFile )
@@ -110,7 +115,7 @@ void CompiledFileName( int hObjFile, char * szFileName )
putbyte( wLen, hObjFile ); /* szFileName length */
bChk += wLen;
while( bChar = * szFileName++ )
while( (bChar = * szFileName++) )
{
putbyte( bChar, hObjFile ); /* each of the szFileName characters */
bChk += bChar;
@@ -134,7 +139,7 @@ void CompilerVersion( int hObjFile, char * szVersion )
putword( 0, hObjFile );
while( bChar = * szVersion++ )
while( (bChar = * szVersion++) )
{
putbyte( bChar, hObjFile ); /* each of the szFileName characters */
bChk += bChar;
@@ -148,7 +153,6 @@ void LocalNames( int hObjFile, char * szNames[] )
BYTE b = 0, c;
WORD wTotalLen = 0;
BYTE bChk = 0;
BYTE bChar;
while( szNames[ b ] )
wTotalLen += strlen( szNames[ b++ ] );
@@ -201,7 +205,7 @@ void PubDef( int hObjFile, char * szName, WORD wSegment, WORD wOffset )
putbyte( strlen( szName ), hObjFile );
bChk += strlen( szName );
while( bChar = * szName++ )
while( (bChar = * szName++) )
{
putbyte( bChar, hObjFile );
bChk += bChar;
@@ -220,7 +224,6 @@ void ExternalNames( int hObjFile, char * szNames[] )
BYTE b = 0, c;
WORD wTotalLen = 0;
BYTE bChk = 0;
BYTE bChar;
while( szNames[ b ] )
wTotalLen += strlen( szNames[ b++ ] ) + 1;
@@ -389,7 +392,6 @@ void Fixup( int hObjFile, BYTE bType, WORD wOffset, BYTE bFlags, BYTE bSymbol )
void End( int hObjFile )
{
BYTE bChk = 0;
BYTE bChar;
putbyte( 0x8A, hObjFile ); bChk += 0x8A;

View File

@@ -47,4 +47,8 @@ PRG_SOURCES=\
val.prg \
while.prg \
LIBS=\
vm \
rtl \
include $(TOP)$(ROOT)config/test.cf

View File

@@ -1,77 +1,39 @@
// Testing Harbour statics variables management
static z := "First"
function Main()
LOCAL i
static a := "Hello", b := { 1, 3 }
QOut( a )
QOut( b[ 2 ] )
Two()
QOut( "Ok!" )
FOR i:=1 TO 10
NumStat()
NEXT
return nil
function Two()
static a := "Test"
QOut( a )
return nil
FUNCTION THREE( p )
QOut( p )
RETURN p
PROCEDURE NumStat()
STATIC n:=0
QOut( ++n )
QOut( z )
RETURN