project-navigation
Personal tools

Author Topic: Pointers to strings  (Read 3693 times)

oeystein

  • Guest
Pointers to strings
« on: July 15, 2007, 07:20:33 pm »
I've just compiled the source, but I'm having some problems with the different string pointers used. In sys_win.c the compiler(VS2005 pro) throws 21 warnings about incompatible types. Example: warning C4133: 'function' : incompatible types - from 'char [12]' to 'LPCWSTR'
This causes the string functions to return erroneus values.

Should I try to undef UNICODE or is there som other way to adress this issue?

The sourcecode was downloaded from trunk yesterday.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Pointers to strings
« Reply #1 on: July 15, 2007, 07:43:07 pm »
well, noone here is using visualC - i you are using it and you can compile and link ufo, it would be nice if you would send patches

oeystein

  • Guest
Pointers to strings
« Reply #2 on: July 15, 2007, 07:55:57 pm »
Well, I can look into it and see what I can do. Which compiler do you guys use. If noone is using Visual, maybe i should just change to another compiler. Where and how do I send the patches. I'm afraid that if I start using MS-specific types I might break the project for other compilers.

Also, the file intl.dll that was included in trunk had a dependency to "msvcr80.dll" which was not found. The intl.dll downloaded from http://www.files.lanas.de/ufo/dlls.zip seemed to fix the problem.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Pointers to strings
« Reply #3 on: July 15, 2007, 08:59:52 pm »
we are mainly using gcc - but it is always good to compile the code with different compilers - patches can be sent to our patchtracker at the sourceforge.net project files - also see our wiki for more compiling information.

oeystein

  • Guest
Pointers to strings
« Reply #4 on: July 15, 2007, 10:38:49 pm »
Getting uninitialized variable at idx(bottom of the page). Is this some debugging residue? I compiled without #define debug

Code: [Select]


static float AIRFIGHT_ProbabilityToHit (aircraft_t *shooter, aircraft_t *target, int slotIdx)
{
int idx;
float probability = 0.0f;

#ifdef DEBUG
idx = shooter->weapons[slotIdx].itemIdx;
if (idx < 0) {
Com_Printf("AIRFIGHT_ProbabilityToHit: no weapon assigned to attacking aircraft\n");
return probability;
}

idx = shooter->weapons[slotIdx].ammoIdx;
if (idx < 0) {
Com_Printf("AIRFIGHT_ProbabilityToHit: no ammo in weapon of attacking aircraft\n");
return probability;
}
#endif

/* Take Base probability from the ammo of the attacking aircraft */
probability = aircraftItems[idx].stats[AIR_STATS_ACCURACY];


Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Pointers to strings
« Reply #5 on: July 16, 2007, 07:22:17 am »
fixed in latest revision - thanks

Offline blondandy

  • Sergeant
  • *****
  • Posts: 391
    • View Profile
Pointers to strings
« Reply #6 on: July 16, 2007, 10:14:53 am »
the repo includes project files for the windows for the dev-cpp IDE.

http://ufoai.ninex.info/wiki/index.php/Compile_for_Windows