From: Jan Engelhardt Date: 2012-03-25 16:06:07.551725021 +0200 --- BlockOut/EditControl.cpp | 2 +- BlockOut/EditControl.h | 2 +- BlockOut/GLApp/GLApp.h | 2 +- BlockOut/GLApp/GLFont.cpp | 3 +-- BlockOut/GLApp/GLSprite.cpp | 4 ++-- BlockOut/GLApp/GLSprite.h | 2 +- BlockOut/Menu.h | 4 ++-- BlockOut/MenuGraphics.cpp | 4 ++-- BlockOut/SetupManager.cpp | 2 +- BlockOut/SetupManager.h | 2 +- BlockOut/Types.h | 6 +++--- BlockOut/Utils.cpp | 6 +++--- ImageLib/src/jpg/jpegdecoder.cpp | 6 +++--- ImageLib/src/png/hpng.c | 6 +----- 14 files changed, 23 insertions(+), 28 deletions(-) Index: bl24_lin_src/BlockOut/EditControl.cpp =================================================================== --- bl24_lin_src.orig/BlockOut/EditControl.cpp +++ bl24_lin_src/BlockOut/EditControl.cpp @@ -30,7 +30,7 @@ void EditControl::SetDisplayLength(int l // ------------------------------------------------ -void EditControl::SetMode(char *text,BOOL edit,BYTE *keys) { +void EditControl::SetMode(const char *text,BOOL edit,BYTE *keys) { if( strlen(text)>=255 ) { strncpy(editText,text,255); Index: bl24_lin_src/BlockOut/EditControl.h =================================================================== --- bl24_lin_src.orig/BlockOut/EditControl.h +++ bl24_lin_src/BlockOut/EditControl.h @@ -27,7 +27,7 @@ class EditControl { void SetDisplayLength(int length); // Set edit control mode (keys can be NULL) - void SetMode(char *text,BOOL edit,BYTE *keys); + void SetMode(const char *text,BOOL edit,BYTE *keys); // Get the mode BOOL GetMode(); Index: bl24_lin_src/BlockOut/GLApp/GLApp.h =================================================================== --- bl24_lin_src.orig/BlockOut/GLApp/GLApp.h +++ bl24_lin_src/BlockOut/GLApp/GLApp.h @@ -57,7 +57,7 @@ protected: // Internal variables for the state of the app BOOL m_bWindowed; - char* m_strWindowTitle; + const char *m_strWindowTitle; int m_screenWidth; int m_screenHeight; Index: bl24_lin_src/BlockOut/GLApp/GLFont.cpp =================================================================== --- bl24_lin_src.orig/BlockOut/GLApp/GLFont.cpp +++ bl24_lin_src/BlockOut/GLApp/GLFont.cpp @@ -6,8 +6,7 @@ #include #include #include - -extern char *LID(char *fileName); +#include "../Types.h" // ------------------------------------------- Index: bl24_lin_src/BlockOut/GLApp/GLSprite.cpp =================================================================== --- bl24_lin_src.orig/BlockOut/GLApp/GLSprite.cpp +++ bl24_lin_src/BlockOut/GLApp/GLSprite.cpp @@ -6,8 +6,8 @@ #include #include #include +#include "../Types.h" -extern char *LID(char *fileName); // ------------------------------------------- @@ -53,7 +53,7 @@ void Sprite2D::UpdateSprite(int x1,int y // ------------------------------------------- -int Sprite2D::RestoreDeviceObjects(char *diffName,char *alphaName,int scrWidth,int scrHeight) { +int Sprite2D::RestoreDeviceObjects(const char *diffName, const char *alphaName,int scrWidth,int scrHeight) { GLint bpp; GLenum format; Index: bl24_lin_src/BlockOut/GLApp/GLSprite.h =================================================================== --- bl24_lin_src.orig/BlockOut/GLApp/GLSprite.h +++ bl24_lin_src/BlockOut/GLApp/GLSprite.h @@ -15,7 +15,7 @@ public: // Initialise the font // return 1 when success, 0 otherwise - int RestoreDeviceObjects(char *diffName,char *alphaName,int srcWidth,int scrHeight); + int RestoreDeviceObjects(const char *diffName, const char *alphaName,int srcWidth,int scrHeight); // Update sprite mapping and coordinates void UpdateSprite(int x1,int y1,int x2,int y2); Index: bl24_lin_src/BlockOut/Menu.h =================================================================== --- bl24_lin_src.orig/BlockOut/Menu.h +++ bl24_lin_src/BlockOut/Menu.h @@ -60,8 +60,8 @@ class Menu { // Menu page void ToPage(MenuPage *page); void ToPage(MenuPage *page,int iParam,void *wParam); - void RenderText(int x,int y,BOOL selected,char *text); - void RenderTitle(char *title); + void RenderText(int x,int y,BOOL selected, const char *text); + void RenderTitle(const char *title); PageMainMenu mainMenuPage; PageStartGame startGamePage; Index: bl24_lin_src/BlockOut/MenuGraphics.cpp =================================================================== --- bl24_lin_src.orig/BlockOut/MenuGraphics.cpp +++ bl24_lin_src/BlockOut/MenuGraphics.cpp @@ -438,7 +438,7 @@ void Menu::RenderChar(int x,int y,int w, // --------------------------------------------------------------------- -void Menu::RenderTitle(char *title) { +void Menu::RenderTitle(const char *title) { int lgth = strlen(title); int nwFont = fround((float)wFont*1.1f); @@ -454,7 +454,7 @@ void Menu::RenderTitle(char *title) { // --------------------------------------------------------------------- -void Menu::RenderText(int x,int y,BOOL selected,char *text) { +void Menu::RenderText(int x,int y,BOOL selected, const char *text) { float startLine = 0.515f; float startColumn = 0.15f; Index: bl24_lin_src/BlockOut/SetupManager.cpp =================================================================== --- bl24_lin_src.orig/BlockOut/SetupManager.cpp +++ bl24_lin_src/BlockOut/SetupManager.cpp @@ -363,7 +363,7 @@ int SetupManager::GetTimeout() { // ------------------------------------------------ -char *SetupManager::GetName() { +const char *SetupManager::GetName() { static char ret[32]; strcpy(ret,""); Index: bl24_lin_src/BlockOut/SetupManager.h =================================================================== --- bl24_lin_src.orig/BlockOut/SetupManager.h +++ bl24_lin_src/BlockOut/SetupManager.h @@ -49,7 +49,7 @@ class SetupManager { float GetAnimationTime(); /* in seconds */ // Names - char *GetName(); + const char *GetName(); const char *GetBlockSetName(); // Sound Index: bl24_lin_src/BlockOut/Types.h =================================================================== --- bl24_lin_src.orig/BlockOut/Types.h +++ bl24_lin_src/BlockOut/Types.h @@ -160,13 +160,13 @@ extern int fround(float x); extern char *FormatTime(float seconds); extern char *FormatDate(int time); extern char *FormatDateShort(int time); -extern int CreateTexture(int width,int height,char *imgName,GLuint *hmap); +extern int CreateTexture(int width,int height, const char *imgName,GLuint *hmap); extern char GetChar(BYTE *keys); extern void ZeroMemory(void *buff,int size); extern BOOL DirExists(char *dirname); extern BOOL CheckEnv(); -extern char *LID(char *fileName); -extern char *LHD(char *fileName); +extern char *LID(const char *fileName); +extern char *LHD(const char *fileName); #endif /* TYPESH */ Index: bl24_lin_src/BlockOut/Utils.cpp =================================================================== --- bl24_lin_src.orig/BlockOut/Utils.cpp +++ bl24_lin_src/BlockOut/Utils.cpp @@ -191,7 +191,7 @@ BOOL CheckEnv() { // Name: LID() // Desc: Locate file in the installation directory //----------------------------------------------------------------------------- -char *LID(char *fileName) { +char *LID(const char *fileName) { static char ret[512]; sprintf(ret,"%s/%s",bl2Home,fileName); @@ -203,7 +203,7 @@ char *LID(char *fileName) { // Name: LHD() // Desc: Locate file in the home directory //----------------------------------------------------------------------------- -char *LHD(char *fileName) { +char *LHD(const char *fileName) { static char ret[512]; sprintf(ret,"%s/%s",usrHome,fileName); @@ -217,7 +217,7 @@ char *LHD(char *fileName) { // Name: CreateTexture() // Desc: Create a texture (no alpha) //----------------------------------------------------------------------------- -int CreateTexture(int width,int height,char *imgName,GLuint *hmap) { +int CreateTexture(int width,int height, const char *imgName,GLuint *hmap) { *hmap = 0; CImage img; Index: bl24_lin_src/ImageLib/src/jpg/jpegdecoder.cpp =================================================================== --- bl24_lin_src.orig/ImageLib/src/jpg/jpegdecoder.cpp +++ bl24_lin_src/ImageLib/src/jpg/jpegdecoder.cpp @@ -106,7 +106,7 @@ void *jpeg_decoder::alloc(int n) blocks[i] = q; // Round to qword boundry, to avoid misaligned accesses with MMX code - return ((void *)(((uint)q + 7) & ~7)); + return ((void *)(((unsigned long)q + 7) & ~7)); } //------------------------------------------------------------------------------ // Clear buffer to word values. @@ -1884,7 +1884,7 @@ void jpeg_decoder::init_frame(void) q = (uchar *)alloc(max_blocks_per_row * 64 * sizeof(BLOCK_TYPE) + 8); // Align to 8-byte boundry, for MMX code - q = (uchar *)(((uint)q + 7) & ~7); + q = (uchar *)(((unsigned long)q + 7) & ~7); // The block_seg[] array's name dates back to the // 16-bit assembler implementation. "seg" stood for "segment". @@ -1894,7 +1894,7 @@ void jpeg_decoder::init_frame(void) for (i = 0; i < max_blocks_per_row; i++) block_max_zag_set[i] = 64; - Psample_buf = (uchar *)(((uint)alloc(max_blocks_per_row * 64 + 8) + 7) & ~7); + Psample_buf = (uchar *)(((unsigned long)alloc(max_blocks_per_row * 64 + 8) + 7) & ~7); total_lines_left = image_y_size; Index: bl24_lin_src/ImageLib/src/png/hpng.c =================================================================== --- bl24_lin_src.orig/ImageLib/src/png/hpng.c +++ bl24_lin_src/ImageLib/src/png/hpng.c @@ -45,10 +45,6 @@ int LoadPngImage(PNG_IMAGE *d) { // ---------------- Error handling png_set_error_fn(png,NULL,my_png_error,NULL); - if (setjmp(png->jmpbuf)) { - png_destroy_read_struct(&png, &info, &endinfo); - return 0; - } // ----------------- Read the image @@ -154,7 +150,7 @@ char *WritePngImage(char *file_name,unsi { sprintf(PngErrorMessage,"png_create_info_struct() failed"); fclose(fp); - png_destroy_write_struct(&png_ptr, png_infopp_NULL); + png_destroy_write_struct(&png_ptr, NULL); return PngErrorMessage; }