The Dink Network

Reply to Re: Maybe a bug

If you don't have an account, just leave the password field blank.
Username:
Password:
Subject:
Antispam: Enter Dink Smallwood's last name (surname) below.
Formatting: :) :( ;( :P ;) :D >( : :s :O evil cat blood
Bold font Italic font hyperlink Code tags
Message:
 
 
December 6th 2005, 10:48 AM
anon.gif
toa
Ghost They/Them
 
Disagree!?

Code is code. There is no opinion, Luke, only right or right-not.

"if c was intended to be only byte sized, then it would have been a waste to code it as a 2 byte address, considering the platform this was written to."

C is the character already read. If C >= 128, it's the number of pair definitions following in the file. ((c-128)*2 bytes in the table)

C is NOT intended to be byte-sized. C, as returned from getc(), is an int (which can be anywhere from sizeof(char) bytes to 523MB, depending on the hardware). The reason it's returned as an int is to allow a full range of character codes AND a sentinal value to singal error conditions. If it is declared short, that's acceptable only because it allows the same range and sentinal value.

And the "> 255" will always return false. In the other function (which handles decompression), it's done correctly. (If I remember correctly: "> 127".) Apparantly, Seth was lazy and just changed one number to kill unwanted code instead of actually removing it.