Re: [Warzone-dev] Re: [Warzone-commits] r488 - in/trunk: lib/framework/ lib/script/ src/

2006-11-19 Thread Giel van Schijndel
Troman schreef:
>> The "result" didn't look static. Which means that it becomes a global
>> symbol,
>> which then clashes with the other global "result" symbols in the other
>> files...
> Beats me...
Well, I understand it, in fact I even thought it might have something to
do with the `static' keyword but figured that wasn't it (doh! I thought
the static keyword achieve the opposite, i.e. causing the linker
errors). Shouldn't have dismissed that thought, should have tried it
instead. So Dennis maybe I should have you as a teacher, lol.
>> Just mark that result static and the linker errors will go away.
>>
>> --Dennis
>>
>> PS:  You may hit me if I'm wrong. ;)
> No magic involved.
>
> Sure, we'll remember that, but this time you escaped the punishment ;P
I doubt he meant that for all subjects he could be wrong about, but sure
you can interpret it that way.
Anyhow it seems to have fixed all linker errors.

So good job to the both of you, cheers.

--
Giel



signature.asc
Description: OpenPGP digital signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r488 - in/trunk: lib/framework/ lib/script/ src/

2006-11-19 Thread Troman

Am Sonntag, 19. November 2006 18:06 schrieb Giel van Schijndel:

Troman schreef:
> Let me know if 'last_called_script_event' warnings are still there.
> I'm not sure what's wrong with 'result' though, maybe i'm just blind
> or linker is going berserk.
>
> Troman

The `result' errors are still there.

The main difference there that causes these linker errors seems to be
the tight integration of `INTERP_VAL result' in these files:
src/scriptai.c src/scriptcb.c src/scriptfuncs.c src/scriptobj.c

Just look through this diff:
http://svn.gna.org/viewcvs/warzone/trunk/src/scriptai.c?rev=488&view=diff&r
1=488&r2=487&p1=trunk/src/scriptai.c&p2=/trunk/src/scriptai.c

You'll see that `result' is being used quite heavily to replace numerous
variables, it seems however that the linker is trying to assign the
exact same memory address to these instances of `result', which is in
effect triggering the linker errors. (Or something like it, I believe
I've stated before I'm far from an expert on fixing linker errors.)
The "result" didn't look static. Which means that it becomes a global 
symbol,

which then clashes with the other global "result" symbols in the other
files...


Beats me...


No magic involved.
Just mark that result static and the linker errors will go away.

--Dennis

PS:  You may hit me if I'm wrong. ;)


Sure, we'll remember that, but this time you escaped the punishment ;P 



___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r488 - in /trunk: lib/framework/ lib/script/ src/

2006-11-19 Thread Dennis Schridde
Am Sonntag, 19. November 2006 18:06 schrieb Giel van Schijndel:
> Troman schreef:
> > Let me know if 'last_called_script_event' warnings are still there.
> > I'm not sure what's wrong with 'result' though, maybe i'm just blind
> > or linker is going berserk.
> >
> > Troman
>
> The `result' errors are still there.
>
> The main difference there that causes these linker errors seems to be
> the tight integration of `INTERP_VAL result' in these files:
> src/scriptai.c src/scriptcb.c src/scriptfuncs.c src/scriptobj.c
>
> Just look through this diff:
> http://svn.gna.org/viewcvs/warzone/trunk/src/scriptai.c?rev=488&view=diff&r
>1=488&r2=487&p1=trunk/src/scriptai.c&p2=/trunk/src/scriptai.c
>
> You'll see that `result' is being used quite heavily to replace numerous
> variables, it seems however that the linker is trying to assign the
> exact same memory address to these instances of `result', which is in
> effect triggering the linker errors. (Or something like it, I believe
> I've stated before I'm far from an expert on fixing linker errors.)
The "result" didn't look static. Which means that it becomes a global symbol, 
which then clashes with the other global "result" symbols in the other 
files... No magic involved.
Just mark that result static and the linker errors will go away.

--Dennis

PS:  You may hit me if I'm wrong. ;)


pgpNrsUnJ47V7.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r488 - in /trunk: lib/framework/ lib/script/ src/

2006-11-19 Thread Giel van Schijndel
Troman schreef:
> Let me know if 'last_called_script_event' warnings are still there.
> I'm not sure what's wrong with 'result' though, maybe i'm just blind
> or linker is going berserk.
>
> Troman

The `result' errors are still there.

The main difference there that causes these linker errors seems to be
the tight integration of `INTERP_VAL result' in these files:
src/scriptai.c src/scriptcb.c src/scriptfuncs.c src/scriptobj.c

Just look through this diff:
http://svn.gna.org/viewcvs/warzone/trunk/src/scriptai.c?rev=488&view=diff&r1=488&r2=487&p1=trunk/src/scriptai.c&p2=/trunk/src/scriptai.c

You'll see that `result' is being used quite heavily to replace numerous
variables, it seems however that the linker is trying to assign the
exact same memory address to these instances of `result', which is in
effect triggering the linker errors. (Or something like it, I believe
I've stated before I'm far from an expert on fixing linker errors.)

--
Giel
linker command:
g++ -m32 -DVERSION=\"2.0.4\" -DYY_STATIC -I.. -I../.. 
-IC:\Warzone-DevPkg/include -fpermissive -Wall -O0 -g3 -DDEBUG -mwindows 
-DWIN32 -o warzone2100.exe ai.o aiexperience.o astar.o action.o advvis.o 
atmos.o bridge.o buildpos.o cdspan.o cheat.o cluster.o cmddroid.o combat.o 
component.o console.o data.o design.o difficulty.o disp2d.o display.o droid.o 
e3demo.o edit2d.o edit3d.o effects.o environ.o fpath.o feature.o findpath.o 
formation.o frontend.o gateway.o gatewayroute.o gatewaysup.o geometry.o group.o 
hci.o init.o intdisplay.o intimage.o intorder.o intelmap.o keybind.o keymap.o 
level_lexer.o levels.o lighting.o loop.o map.o mapdisplay.o mapgrid.o 
mechanics.o message.o miscimd.o move.o multiint.o multimenu.o multiopt.o 
multisync.o multibot.o multistat.o objmem.o objects.o optimisepath.o order.o 
player.o powercrypt.o radar.o raycast.o research.o scores.o scriptai.o 
scriptcb.o scriptextern.o scriptfuncs.o scriptobj.o scripttabs.o scriptvals.o 
scriptvals_parser.o scriptvals_lexer.o selection.o stats.o text.o texture.o 
transporter.o visibility.o warcam.o wrappers.o ani.o arrow.o aud.o audio_id.o 
bucket3d.o clparse.o configuration.o csnap.o display3d.o drive.o function.o 
game.o ingameop.o keyedit.o loadsave.o main.o mission.o multigifts.o 
multijoin.o multilimit.o multiplay.o multistruct.o oprint.o power.o 
projectile.o seqdisp.o structure.o target.o warzoneconfig.o 
../win32/warzone2100.o ../lib/libframework.a ../lib/libgamelib.a 
../lib/libivis_common.a ../lib/libivis_opengl.a ../lib/libnetplay.a 
../lib/libscript.a ../lib/libsequence.a ../lib/libsound.a ../lib/libwidget.a 
-LC:\Warzone-DevPkg/lib -lmingw32 -lglu32 -lopengl32 -lopenal32 -ljpeg6b 
-lpng13 -lmad -lvorbisfile -lvorbis -logg -lphysfs -lSDLmain -lSDL -lSDL_net

stderr:
scriptcb.o(.bss+0x0): In function `Z15scrCBDroidTakenv':
C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptcb.c:55: multiple definition of `result'
scriptai.o(.bss+0x0):C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptai.c:35: first defined here
scriptfuncs.o(.bss+0x0): In function `strncasecmp':
C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptfuncs.c: multiple definition of `result'
scriptai.o(.bss+0x0):C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptai.c:35: first defined here
scriptobj.o(.bss+0x0): In function `Z13scrBaseObjGetj':
C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptobj.c:35: multiple definition of `result'
scriptai.o(.bss+0x0):C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptai.c:35: first defined here
collect2: ld returned 1 exit status


signature.asc
Description: OpenPGP digital signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r488 - in /trunk: lib/framework/ lib/script/ src/

2006-11-18 Thread Troman
Let me know if 'last_called_script_event' warnings are still there. I'm not 
sure what's wrong with 'result' though, maybe i'm just blind or linker is 
going berserk.


Troman

- Original Message - 
From: "Giel van Schijndel" <[EMAIL PROTECTED]>

To: 
Sent: Friday, November 17, 2006 10:01 PM
Subject: [Warzone-dev] Re: [Warzone-commits] r488 - in /trunk: 
lib/framework/ lib/script/ src/



Roman schreef:

Author: troman
Date: Thu Nov 16 15:30:29 2006
New Revision: 488

URL: http://svn.gna.org/viewcvs/warzone?rev=488&view=rev
Log:
Scripting engine overhaul - Part I
-compiler and parts of interpreter now use union to store different data 
types

-got rid of a great deal of pointer->integer casts

-ASSERT() now outputs last event (or function) called by scripts
-implemented float data type support for the scripting engine - basic 
functionality at the moment


Modified:
trunk/lib/framework/debug.h
trunk/lib/script/event.c
trunk/lib/script/event.h
trunk/lib/script/interp.c
trunk/lib/script/interp.h
trunk/lib/script/parse.h
trunk/lib/script/script.h
trunk/lib/script/script_lexer.l
trunk/lib/script/script_parser.y
trunk/lib/script/stack.c
trunk/lib/script/stack.h
trunk/src/scriptai.c
trunk/src/scriptcb.c
trunk/src/scriptextern.c
trunk/src/scriptfuncs.c
trunk/src/scriptobj.c
trunk/src/scriptvals.

I don't want to be annoying or something, but since these changes I'm
getting a lot of linker errors.
I'm really not good at fixing linker errors (doesn't mean I can't do it,
but I can't today, tomorrow and Sunday, so if anyone wants to fix it,
this info might help).


See attachments for linker errors. Just to inform you: I can compile and
link r487 without a problem.

--
Giel







linker command:
g++ -m32 -DVERSION=\"2.0.4\" -DYY_STATIC -I.. -I../.. -IC:\Warzone-DevPkg/include 
 -fpermissive -Wall -O0 -g3 -DDEBUG -mwindows -DWIN32 -o warzone2100.exe 
ai.o aiexperience.o astar.o action.o advvis.o atmos.o bridge.o buildpos.o 
cdspan.o cheat.o cluster.o cmddroid.o combat.o component.o console.o 
data.o design.o difficulty.o disp2d.o display.o droid.o e3demo.o edit2d.o 
edit3d.o effects.o environ.o fpath.o feature.o findpath.o formation.o 
frontend.o gateway.o gatewayroute.o gatewaysup.o geometry.o group.o hci.o 
init.o intdisplay.o intimage.o intorder.o intelmap.o keybind.o keymap.o 
level_lexer.o levels.o lighting.o loop.o map.o mapdisplay.o mapgrid.o 
mechanics.o message.o miscimd.o move.o multiint.o multimenu.o multiopt.o 
multisync.o multibot.o multistat.o objmem.o objects.o optimisepath.o 
order.o player.o powercrypt.o radar.o raycast.o research.o scores.o 
scriptai.o scriptcb.o scriptextern.o scriptfuncs.o scriptobj.o 
scripttabs.o scriptvals.o scriptvals_parser.o scriptvals_lexer.o 
selection.o stats.o text.o texture.o transporter.o visibility.o warcam.o 
wrappers.o ani.o arrow.o aud.o audio_id.o bucket3d.o clparse.o 
configuration.o csnap.o display3d.o drive.o function.o game.o ingameop.o 
keyedit.o loadsave.o main.o mission.o multigifts.o multijoin.o 
multilimit.o multiplay.o multistruct.o oprint.o power.o projectile.o 
seqdisp.o structure.o target.o warzoneconfig.o ../win32/warzone2100.o 
../lib/libframework.a ../lib/libgamelib.a ../lib/libivis_common.a 
../lib/libivis_opengl.a ../lib/libnetplay.a ../lib/libscript.a 
../lib/libsequence.a ../lib/libsound.a 
../lib/libwidget.a -LC:\Warzone-DevPkg/lib -lmingw32 -lglu32 -lopengl32 -lopenal32 
 -ljpeg6b -lpng13 -lmad -lvorbisfile -lvorbis -logg -lphysfs -lSDLmain -lSDL 
 -lSDL_net


stderr:
scriptai.o(.bss+0x0): In function `Z16scrGroupAddDroidv':
C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptai.c:35: multiple definition of 
`last_called_script_event'
droid.o(.bss+0x0):C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/droid.c:134: first defined here

scriptcb.o(.bss+0x0): In function `Z15scrCBDroidTakenv':
C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptcb.c:55: multiple definition of 
`last_called_script_event'
droid.o(.bss+0x0):C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/droid.c:134: first defined here

scriptcb.o(.bss+0x64): In function `Z15scrCBDroidTakenv':
C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptcb.c:75: multiple definition of `result'
scriptai.o(.bss+0x64):C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptai.c:44: first defined here

scriptextern.o(.bss+0x0): In function `Z14scrExternResetv':
C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/scriptextern.c:48: multiple definition of 
`last_called_script_event'
droid.o(.bss+0x0):C:/Documents and Settings/Giel van Schijndel/Mijn 
documenten/C++/warzone/src/droid.c:134: first defined here

scriptfuncs.o(.bss+0x0): In fun

Re: [Warzone-dev] Re: [Warzone-commits] r488 - in /trunk: lib/framework/ lib/script/ src/

2006-11-17 Thread Troman

I don't want to be annoying or something, but since these changes I'm
getting a lot of linker errors.
I'm really not good at fixing linker errors (doesn't mean I can't do it,
but I can't today, tomorrow and Sunday, so if anyone wants to fix it,
this info might help).


See attachments for linker errors. Just to inform you: I can compile and
link r487 without a problem.

--
Giel


Wasn't a good idea to define "last_called_script_event" in debug.h. Thanks 
for pointing it out.


Troman 



___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev


Re: [Warzone-dev] Re: [Warzone-commits] r488 - in /trunk: lib/framework/ lib/script/ src/

2006-11-16 Thread Dennis Schridde
Am Donnerstag, 16. November 2006 19:48 schrieb Dennis Schridde:
> Am Donnerstag, 16. November 2006 15:30 schrieb Roman:
> > Author: troman
> > Date: Thu Nov 16 15:30:29 2006
> > New Revision: 488
> >
> > URL: http://svn.gna.org/viewcvs/warzone?rev=488&view=rev
> > Log:
> > Scripting engine overhaul - Part I
> > -compiler and parts of interpreter now use union to store different data
> > types -got rid of a great deal of pointer->integer casts
> >
> > -ASSERT() now outputs last event (or function) called by scripts
> > -implemented float data type support for the scripting engine - basic
> > functionality at the moment
>
> 1st: I get compilation errors:
>
> [67/209] * cc : ../lib/script/codeprint.c -> debug/lib/script/codeprint.o
> In file included from ../lib/script/codeprint.c:7:
> ../lib/framework/frame.h:99: warning: unused parameter ‘uword’
> ../lib/framework/frame.h:110: warning: unused parameter ‘sword’
> ../lib/framework/frame.h:121: warning: unused parameter ‘udword’
> ../lib/framework/frame.h:135: warning: unused parameter ‘sdword’
> ../lib/framework/frame.h:149: warning: unused parameter ‘fract’
> ../lib/script/codeprint.c: In function ‘cpPrintProgram’:
> ../lib/script/codeprint.c:415: warning: assignment from incompatible
> pointer type
> ../lib/script/codeprint.c:425: error: invalid operands to binary -
> ../lib/script/codeprint.c:435: error: invalid operands to binary -
> ../lib/script/codeprint.c:457: warning: zero-length printf format string
> ../lib/script/codeprint.c:462: error: invalid operands to binary -
> ../lib/script/codeprint.c:469: warning: zero-length printf format string
> ../lib/script/codeprint.c:476: error: invalid operands to binary -
> ../lib/script/codeprint.c:483: warning: zero-length printf format string
> ../lib/script/codeprint.c:488: error: invalid operands to binary -
> ../lib/script/codeprint.c:538: error: invalid operands to binary -
> ../lib/script/codeprint.c:542: error: invalid operands to binary -
> ../lib/script/codeprint.c:546: error: invalid operands to binary -
> Compilation failed
>
>
> 2nd: Could you better spell out the namings? I know this is not your fault
> in this particular case, but I had no clue what .v.bval shall be (eg).
> Maybe .Value.Bool or similar would have been better... (Or .value._bool or
> whatever.)
>
> Generally I think we all should keep an eye on the namings of our stuff. It
> might me less to type, but it makes the code much harder to read if we only
> use s, v, a, b and other very descriptive namings.
>
> --Dennis
PS: What is oval???


pgpZWzF7edLWn.pgp
Description: PGP signature
___
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev