Permalink
Browse files

fix a few of the most spammy warnings (there are still hundreds of wa…

…rnings though)

TODO: actually fix all the warnings
  • Loading branch information...
jacob1 committed Oct 23, 2014
1 parent 1652205 commit 6463d04f6cda78847a3b1135c51deb4583ddbd15
@@ -2,7 +2,7 @@
#define FONT_H_CHECK
#define FONT_H 10
#ifdef INCLUDE_FONTDATA
char font_data[] = {
unsigned char font_data[] = {
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -295,7 +295,7 @@ short font_ptrs[] = {
0x11A1, 0x11B1, 0x11C1, 0x11D1, 0x11E1, 0x11F1, 0x1201, 0x1211,
};
#else
extern char font_data[];
extern unsigned char font_data[];
extern short font_ptrs[];
#endif
#endif

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
*/
static unsigned char icon_doc_32_png[] = {
const static unsigned char icon_doc_32_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x08, 0x06, 0x00, 0x00, 0x00, 0x73, 0x7a, 0x7a,
0xf4, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,
@@ -100,7 +100,7 @@ static unsigned char icon_doc_32_png[] = {
0xbf, 0x2f, 0x89, 0x69, 0x46, 0x25, 0x68, 0x1c, 0x6f, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e,
0x44, 0xae, 0x42, 0x60, 0x82
};
static unsigned char icon_doc_16_png[] = {
const static unsigned char icon_doc_16_png[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
0x61, 0x00, 0x00, 0x00, 0x01, 0x73, 0x52, 0x47, 0x42, 0x00, 0xae, 0xce, 0x1c, 0xe9, 0x00, 0x00,

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -87,10 +87,10 @@ std::string format::CleanString(std::string dirtyString, size_t maxVisualSize, s
{
newString = newString.substr(0, maxVisualSize/10);
}
for(int i = 0; i < newString.size(); i++){
if(!(newString[i]>=' ' && newString[i]<127)){ //Clamp to ASCII range
for (unsigned int i = 0; i < newString.size(); i++)
{
if (!(newString[i]>=' ' && newString[i]<127)) //Clamp to ASCII range
newString[i] = '?'; //Replace with "huh" char
}
}
return newString;
}
@@ -113,10 +113,10 @@ std::string format::CleanString(char * dirtyData, size_t maxVisualSize, size_t m
{
newString = newString.substr(0, maxVisualSize/10);
}
for(int i = 0; i < newString.size(); i++){
if(!(newString[i]>=' ' && newString[i]<127)){ //Clamp to ASCII range
for (unsigned int i = 0; i < newString.size(); i++)
{
if (!(newString[i]>=' ' && newString[i]<127)) //Clamp to ASCII range
newString[i] = '?'; //Replace with "huh" char
}
}
return newString;
}
@@ -7,7 +7,7 @@ class VideoBuffer;
namespace format
{
static char hex[] = "0123456789ABCDEF";
const static char hex[] = "0123456789ABCDEF";
template <typename T> std::string NumberToString(T number)
{
@@ -20,6 +20,7 @@
#include <mach-o/dyld.h>
#endif
const static char hex[] = "0123456789ABCDEF";
std::string URLEscape(std::string source)
{
char * src = (char *)source.c_str();
@@ -161,14 +162,16 @@ void strlist_free(struct strlist **list)
}
}
void clean_text(char *text, int vwidth)
void clean_text(char *text, unsigned int vwidth)
{
int i = 0;
if(strlen(text)*10 > vwidth){
if (strlen(text)*10 > vwidth)
{
text[vwidth/10] = 0;
}
for(i = 0; i < strlen(text); i++){
if(! (text[i]>=' ' && text[i]<127)){
for (unsigned i = 0; i < strlen(text); i++)
{
if (! (text[i]>=' ' && text[i]<127))
{
text[i] = ' ';
}
}
@@ -626,7 +629,7 @@ void membwand(void * destv, void * srcv, size_t destsize, size_t srcsize)
int splitsign(const char* str, char * type)
{
int match=0,r;
int r;
if (str[0]=='{' && (str[1]=='c' || str[1]=='t' || str[1]=='b'))
{
const char* p=str+2;
@@ -22,8 +22,6 @@ __asm__ __volatile ("cpuid":\
"=a" (af), "=b" (bf), "=c" (cf), "=d" (df) : "a" (func));
#endif
static char hex[] = "0123456789ABCDEF";
char *exe_name(void);
//Linear interpolation
@@ -333,7 +333,7 @@ int SDLOpen()
SendMessage(WindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)hIconSmall);
SendMessage(WindowHandle, WM_SETICON, ICON_BIG, (LPARAM)hIconBig);
#elif defined(LIN)
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom(app_icon, 16, 16, 32, 64, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
SDL_Surface *icon = SDL_CreateRGBSurfaceFrom((void*)app_icon, 16, 16, 32, 64, 0x000000FF, 0x0000FF00, 0x00FF0000, 0xFF000000);
SDL_WM_SetIcon(icon, NULL);
#endif
@@ -949,7 +949,7 @@ int main(int argc, char * argv[])
{
std::string saveIdPart = "";
int saveId;
int hashPos = ptsaveArg.find('#');
unsigned int hashPos = ptsaveArg.find('#');
if(hashPos != std::string::npos)
{
saveIdPart = ptsaveArg.substr(7, hashPos-7);
@@ -67,10 +67,10 @@ void writeUserPreferences(const char * prefData);
Client::Client():
authUser(0, ""),
updateAvailable(false),
messageOfTheDay(""),
versionCheckRequest(NULL),
messageOfTheDay("")
updateAvailable(false),
authUser(0, "")
{
int i = 0;
for(i = 0; i < THUMB_CACHE_SIZE; i++)
@@ -40,9 +40,9 @@ class UpdateInfo
int Build;
int Time;
BuildType Type;
UpdateInfo() : Major(0), Minor(0), Build(0), Time(0), File(""), Type(Stable) {}
UpdateInfo(int major, int minor, int build, std::string file, BuildType type) : Major(major), Minor(minor), Build(build), Time(0), File(file), Type(type) {}
UpdateInfo(int time, std::string file, BuildType type) : Major(0), Minor(0), Build(0), Time(time), File(file), Type(type) {}
UpdateInfo() : File(""), Major(0), Minor(0), Build(0), Time(0), Type(Stable) {}
UpdateInfo(int major, int minor, int build, std::string file, BuildType type) : File(file), Major(major), Minor(minor), Build(build), Time(0), Type(type) {}
UpdateInfo(int time, std::string file, BuildType type) : File(file), Major(0), Minor(0), Build(0), Time(time), Type(type) {}
};
class RequestListener;
@@ -973,7 +973,7 @@ void GameSave::readOPS(char * data, int dataLength)
int caddress = restrict_flt(restrict_flt((float)(particles[newIndex].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
particles[newIndex].type = PT_EMBR;
particles[newIndex].tmp = 1;
particles[newIndex].ctype = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2]));
particles[newIndex].ctype = (((firw_data[caddress]))<<16) | (((firw_data[caddress+1]))<<8) | ((firw_data[caddress+2]));
}
break;
case PT_PSTN:
@@ -1639,7 +1639,7 @@ void GameSave::readPSv(char * data, int dataLength)
int caddress = restrict_flt(restrict_flt((float)(particles[i-1].tmp-4), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
particles[i-1].type = PT_EMBR;
particles[i-1].tmp = 1;
particles[i-1].ctype = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2]));
particles[i-1].ctype = (((firw_data[caddress]))<<16) | (((firw_data[caddress+1]))<<8) | ((firw_data[caddress+2]));
}
}
if (ver < 88) //fix air blowing stickmen
@@ -20,7 +20,7 @@
#ifndef HTTP_H
#define HTTP_H
static char hexChars[] = "0123456789abcdef";
static const char hexChars[] = "0123456789abcdef";
void http_init(char *proxy);
void http_done(void);
@@ -89,7 +89,7 @@ void VideoBuffer::Resize(int width, int height, bool resample, bool fixedRatio)
int VideoBuffer::SetCharacter(int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++);
for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++)
@@ -109,7 +109,7 @@ int VideoBuffer::SetCharacter(int x, int y, int c, int r, int g, int b, int a)
int VideoBuffer::BlendCharacter(int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++);
for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++)
@@ -129,7 +129,7 @@ int VideoBuffer::BlendCharacter(int x, int y, int c, int r, int g, int b, int a)
int VideoBuffer::AddCharacter(int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++);
for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++)
@@ -136,7 +136,7 @@ int PIXELMETHODS_CLASS::drawtext(int x, int y, std::string s, int r, int g, int
int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++);
VideoBuffer texture(w, 12);
texture.SetCharacter(0, 0, c, r, g, b, a);
@@ -166,7 +166,7 @@ int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a
int PIXELMETHODS_CLASS::addchar(int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++);
VideoBuffer texture(w, 12);
texture.AddCharacter(0, 0, c, r, g, b, a);
@@ -111,7 +111,7 @@ int PIXELMETHODS_CLASS::drawtext(int x, int y, std::string s, int r, int g, int
int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++);
for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++)
@@ -131,7 +131,7 @@ int PIXELMETHODS_CLASS::drawchar(int x, int y, int c, int r, int g, int b, int a
int PIXELMETHODS_CLASS::addchar(int x, int y, int c, int r, int g, int b, int a)
{
int i, j, w, bn = 0, ba = 0;
char *rp = font_data + font_ptrs[c];
unsigned char *rp = font_data + font_ptrs[c];
w = *(rp++);
for (j=0; j<FONT_H; j++)
for (i=0; i<w; i++)
@@ -1280,9 +1280,9 @@ void Renderer::render_parts()
{
caddress = restrict_flt((int)( restrict_flt((float)(sim->parts[i].temp+(-MIN_TEMP)), 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3);
firea = 255;
firer = colr = (unsigned char)color_data[caddress];
fireg = colg = (unsigned char)color_data[caddress+1];
fireb = colb = (unsigned char)color_data[caddress+2];
firer = colr = color_data[caddress];
fireg = colg = color_data[caddress+1];
fireb = colb = color_data[caddress+2];
cola = 255;
if(pixel_mode & (FIREMODE | PMODE_GLOW))
pixel_mode = (pixel_mode & ~(FIREMODE|PMODE_GLOW)) | PMODE_BLUR;
@@ -2268,7 +2268,7 @@ void Renderer::draw_air()
{
float ttemp = hv[y][x]+(-MIN_TEMP);
int caddress = restrict_flt((int)( restrict_flt(ttemp, 0.0f, MAX_TEMP+(-MIN_TEMP)) / ((MAX_TEMP+(-MIN_TEMP))/1024) ) *3, 0.0f, (1024.0f*3)-3);
c = PIXRGB((int)((unsigned char)color_data[caddress]*0.7f), (int)((unsigned char)color_data[caddress+1]*0.7f), (int)((unsigned char)color_data[caddress+2]*0.7f));
c = PIXRGB((int)(color_data[caddress]*0.7f), (int)(color_data[caddress+1]*0.7f), (int)(color_data[caddress+2]*0.7f));
//c = PIXRGB(clamp_flt(fabsf(vx[y][x]), 0.0f, 8.0f),//vx adds red
// clamp_flt(hv[y][x], 0.0f, 1600.0f),//heat adds green
// clamp_flt(fabsf(vy[y][x]), 0.0f, 8.0f));//vy adds blue
@@ -36,10 +36,10 @@ class Brush
}
public:
Brush(ui::Point size_):
bitmap(NULL),
outline(NULL),
radius(0, 0),
size(0, 0)
bitmap(NULL),
size(0, 0),
radius(0, 0)
{
SetRadius(size_);
};
@@ -19,7 +19,7 @@ class Menu
virtual ~Menu()
{
for(int i = 0; i < tools.size(); i++)
for(unsigned int i = 0; i < tools.size(); i++)
{
delete tools[i];
}
@@ -26,10 +26,10 @@ class QuickOption
std::string icon;
std::string description;
QuickOption(std::string icon, std::string description, GameModel * m, Type type) :
icon(icon),
description(description),
m(m),
type(type)
type(type),
icon(icon),
description(description)
{
}
@@ -122,7 +122,7 @@ void LocalSaveActivity::saveWrite(std::string finalFilename)
void LocalSaveActivity::OnDraw()
{
Graphics * g = ui::Engine::Ref().g;
g->draw_rgba_image((unsigned char*)save_to_disk_image, 0, 0, 0.7f);
g->draw_rgba_image(save_to_disk_image, 0, 0, 0.7f);
g->clearrect(Position.X-2, Position.Y-2, Size.X+3, Size.Y+3);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
@@ -322,7 +322,7 @@ void ServerSaveActivity::OnTick(float dt)
void ServerSaveActivity::OnDraw()
{
Graphics * g = ui::Engine::Ref().g;
g->draw_rgba_image((unsigned char*)save_to_server_image, -10, 0, 0.7f);
g->draw_rgba_image(save_to_server_image, -10, 0, 0.7f);
g->clearrect(Position.X-2, Position.Y-2, Size.X+3, Size.Y+3);
g->drawrect(Position.X, Position.Y, Size.X, Size.Y, 255, 255, 255, 255);
@@ -24,7 +24,7 @@ class SimulationSample
int NumParts;
bool isMouseInSim;
SimulationSample() : PositionX(0), PositionY(0), ParticleID(0), particle(), AirPressure(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), AirTemperature(0), NumParts(0), isMouseInSim(true) {}
SimulationSample() : particle(), ParticleID(0), PositionX(0), PositionY(0), AirPressure(0), AirTemperature(0), AirVelocityX(0), AirVelocityY(0), WallType(0), Gravity(0), GravityVelocityX(0), GravityVelocityY(0), NumParts(0), isMouseInSim(true) {}
};
#endif
@@ -56,9 +56,9 @@ int Element_CFLM::graphics(GRAPHICS_FUNC_ARGS)
{
int caddress = restrict_flt(restrict_flt((float)((int)(cpart->life/2)), 0.0f, 200.0f)*3, 0.0f, (200.0f*3)-3);
*colr = (unsigned char)hflm_data[caddress];
*colg = (unsigned char)hflm_data[caddress+1];
*colb = (unsigned char)hflm_data[caddress+2];
*colr = hflm_data[caddress];
*colg = hflm_data[caddress+1];
*colb = hflm_data[caddress+2];
*firea = 255;
*firer = *colr;
@@ -94,7 +94,7 @@ int Element_FIRW::update(UPDATE_FUNC_ARGS)
float angle, magnitude;
int caddress = (rand()%200)*3;
int n;
unsigned col = (((unsigned char)(firw_data[caddress]))<<16) | (((unsigned char)(firw_data[caddress+1]))<<8) | ((unsigned char)(firw_data[caddress+2]));
unsigned col = (((firw_data[caddress]))<<16) | (((firw_data[caddress+1]))<<8) | ((firw_data[caddress+2]));
for (n=0; n<40; n++)
{
np = sim->create_part(-3, x, y, PT_EMBR);

0 comments on commit 6463d04

Please sign in to comment.