adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] New Windows test (PORTED TO VISUALC)


From: Kenneth Gangstoe
Subject: Re: [Adonthell-devel] New Windows test (PORTED TO VISUALC)
Date: Thu, 11 Apr 2002 12:36:03 +0200
User-agent: Mutt/1.3.24i

I was able to compile the app after some fiddling - you do some weird stuff
in there, at least to what I'm used to see.

Here are some issues you might want to look into for more portability.

1. Use of "using namespace std;" - this totally screws up, so you better
   use std::string, std::endl instead.

2. callback.h:

   enum {MEM_FUNC_SIZE = sizeof(PMemFunc)};
   union{
     PFunc func;
     char memFunc[MEM_FUNC_SIZE];
   };
 
   what exactly are you doing here? It chokes ALOT on the MEM_FUNC_SIZE
   stuff.
   
3. In some sourcefiles (not headerfiles), you keep the default values
   in the parameters. You shouldnt do this, and only keep them in the header 
   files.
   
   Example:
   void image::zoom (const surface& src, u_int16 l, u_int16 h, u_int16 x = 0, 
u_int16 y = 0)
   
4. Statics

   In class joystick_event:
    static const int max_nbr_joysticks = 5;

   You can't set static variables directly in header files.
   
   Secondly, in class control_event:

       static button_type Joystick_map[joystick_event::NBR_BUTTONS * 
                                        joystick_event::max_nbr_joysticks];
                                        
   refering to the max_nbr_joystick here also chokes. You might consider
   using a #define instead or something.
   
   This static stuff is a few other places, can't remember exactly.
   
5. Probably some more issues I forgot.


Now, to the result:

igzstream created
Size of an u_int8: 1
Size of a bool: 1
Size of an u_int16: 2
Size of the file: 2
Now reading the file
Position: -1
Ok
Mask value: 0 - Alpha value: 255
Image dimensions: 52428 x 52428
4294967295 255 4294967295
Stopped reading at position -1
gzeof reports 0
error code set to -1

Values way off! Might be because I broke something during the compile fixes,
esp. regarding the MEM_FUNC_SIZE (I just set it to 4 - would that be somewhat
correct?).

- Kenneth
       
Quoting Alexandre Courbot (address@hidden):
> http://www.gnurou.org/adonthell-stuff/wintest.tgz does now contain a
> simple zlib test. It won't open any SDL display, but will just try to
> read the raw data from test.img. Be carefull, as I don't have included
> the DLLs this time.
> 
> It should run during a few seconds and produce a big stdout.txt
> (300-400K). I'll need it whole to see what happens, if/when it screws up
> and why. Please sent stderr.txt also, in case an error happened.
> 
> The test program (in main.cc) is very simple - it just prints the size
> of a bool, u_int8 and u_int16 (should be 1, 1 and 2), reads the mask,
> alpha value and size of the image (should be 0, 1, 224, 49), will tell
> where it is in the file a few times, and will read every single byte of
> the image and print it on a line, with the previous and current position
> in the file. As the image is mainly white, most of the bytes should be
> equal to 255.
> 
> At the end of the program, it will print the final position, which
> should be 21958. If it fails again there, maybe you can gunzip test.img
> under Windows and check whether it's size is well 21958.
> 
> Hope this will help clearing things up!
> Alex.
> -- 
> http://www.gnurou.org
> 
> 
> _______________________________________________
> Adonthell-devel mailing list
> address@hidden
> http://mail.freesoftware.fsf.org/mailman/listinfo/adonthell-devel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]