Some user-contributed patches to cleanup the build and remove warnings.

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1322 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2010-02-07 11:44:38 +00:00
parent 571cf70b58
commit 056ce73ee9
6 changed files with 11 additions and 7 deletions

View File

@ -34,6 +34,7 @@
#include "misc.h"
#include "operatio.h"
#include "pages.h"
#include "sdlscreen.h"
#include "windows.h"

View File

@ -53,7 +53,7 @@ static byte Palette_has_changed;
static byte Brush_was_altered;
/// Helper function to clamp a double to 0-255 range
inline byte clamp_byte(double value)
static inline byte clamp_byte(double value)
{
if (value<0.0)
return 0;
@ -233,9 +233,10 @@ int L_GetLayerPixel(lua_State* L)
int L_SetColor(lua_State* L)
{
byte c=lua_tonumber(L,1);
byte r=clamp_byte(lua_tonumber(L,2));
byte g=clamp_byte(lua_tonumber(L,3));
byte b=clamp_byte(lua_tonumber(L,4));
byte r=clamp_byte((double)lua_tonumber(L,2));
byte g=clamp_byte((double)lua_tonumber(L,3));
byte b=clamp_byte((double)lua_tonumber(L,4));
Main_palette[c].R=Round_palette_component(r);
Main_palette[c].G=Round_palette_component(g);

View File

@ -422,7 +422,7 @@ static const T_Help_table helptable_credits[] =
HELP_TEXT (" Pasi Kallinen the Peach petter ")
HELP_TEXT (" richienyhus tape.wyrm TeeEmCee ")
HELP_TEXT (" tempest Timo Kurrpa titus^Rab ")
HELP_TEXT (" Tobé 00ai99 ")
HELP_TEXT (" Tobé yakumo9275 00ai99 ")
HELP_TEXT ("")
HELP_TEXT ("")
HELP_TEXT (" ... posted the annoying bug reports.")

View File

@ -1344,7 +1344,7 @@ void Rotate_safety_backups(void)
sprintf(deleted_file, "%s%c%6.6d.bkp",
Config_directory,
Main_safety_backup_prefix,
(Main_safety_number + 1000000l - Rotation_safety_backup) % 1000000l);
(Uint32)(Main_safety_number + 1000000l - Rotation_safety_backup) % (Uint32)1000000l);
remove(deleted_file); // no matter if fail
// Reset counters
@ -1354,7 +1354,7 @@ void Rotate_safety_backups(void)
// Create a new file name and save
sprintf(file_name, "%c%6.6d.bkp",
Main_safety_backup_prefix,
Main_safety_number);
(Unit32)Main_safety_number);
Init_context_layered_image(&context, file_name, Config_directory);
context.Format=FORMAT_GIF;
Save_image(&context);

View File

@ -229,5 +229,6 @@ void Init_preview(short width,short height,long size,int format,enum PIXEL_RATIO
void Init_write_buffer(void);
void Write_one_byte(FILE *file, byte b);
void End_write(FILE *file);
void Rotate_safety_backups(void);
#endif

View File

@ -30,6 +30,7 @@
#include "global.h"
#include "pages.h"
#include "errors.h"
#include "loadsave.h"
#include "misc.h"
#include "windows.h"