TIP: Click on subject to list as thread! ANSI
echo: os2prog
to: Phil Crown
from: Luns Tee
date: 1995-08-15 23:17:52
subject: free()/sys3175

PC> Anybody see any obvious problems with the following code?  Calling
 PC> free(Track_Buffer) under OS/2 causes SYS3175, under DOS there are no
 PC> apparent problems.
 
   Works fine when I build it under C/Set++ 2.0 after removing the
reference to dos.h, and making the fopen mode "r" rather than
"rt" (IBM doesn't accept the t, but it's the default anyway).
 
   A few comments though.. why bother with
 
#define ONE_HALF(x)       (x*50/100)
 
   when putting x/2 or x>>1 is already quite readable? Also, while I
don't know what this program is leading to, your calls of tslice() worry me
- why are you sleeping after each and every character? A program that has
real work to do should just do it - OS/2 will grab the CPU when it's needed
elsewhere.
   Lastly, just a style comment - the use of gloabls makes it easy to break
things since on reading over a function that uses them, you don't know from
the context where they've been and what other code might have done to them.
Better as a habit to pass into a function everything that it's going to be
using. That way, once you have the function working, if on using it
elsewhere, something breaks, you know to look at what you're passing it
rather than having to step your way through the function again to figure
out what it's using.

--- Maximus/2 2.02p1
* Origin: Sol 3 * Toronto * V.32 * (905)858-8488 (1:259/414)
SEEN-BY: 105/42 620/243 711/401 409 410 413 430 807 808 809 934 955 712/407
SEEN-BY: 712/515 628 704 713/888 800/1 7877/2809
@PATH: 259/414 400 99 250/99 3615/50 396/1 270/101 105/103 42 712/515
@PATH: 711/808 809 934

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.