C language > Beginner questions

ImageShop32 - Missing prototype for... What is that?

<< < (2/2)

JohnF:
Most of the warnings can be turned off with this

#ifdef __POCC__
 #pragma warn(disable: 2118) // Parameter 'var' is not referenced
 #pragma warn(disable: 2216) // Return value from function is never used
#endif

The other warnings where the compiler complains about possible loss of data can be dealt with by using casts.

Example

  *lpBuffPtr = cc;

to

  *lpBuffPtr = (BYTE)cc;

You must be confident that the cast will not effect the outcome however. In this case cc is an int but is used to get a char from the file stream so the value will never be greater than 255.

I have sent you a private message about ImageShop32.

John

localmotion34:
Thank you for your help john F, very much. 

I was able to write a PCX decoder, and then encoder, because the last time i posted here, you helped get me a WORKING version of the source, which i was then able to go through step by step and understand. 

the key is always to have something you KNOW works.  Now i can write a decoder/encoder of my own, in my own style of course.  I don't like using HDIBS or HGLOBALS, instead i use CreateDIBitmap after creating a bitmapinfo structure, and decompressing the image data directly to the lpvbits buffer.  thats just me though :).  thank you again for your help. 

Pelle:

--- Quote ---the warning of "Return value from function is never used" - these can't be corrected, don't know why they are reported really
--- End quote ---
Most functions return something for a reason - like an error code, a buffer to free, and so on. If the return value is not used after a call, it may be a bug. If the programmer is convinced this behaviour is correct, the following works (with other compilers too) to silence the warning:


--- Code: ---(void)myfunction();
--- End code ---


...but the #pragma warn(disable ...) woorks too, of course.

Navigation

[0] Message Index

[*] Previous page

Go to full version