[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.28,1.29 editor_ev
From: |
torangan |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.28,1.29 editor_event.cxx,1.30,1.31 editor_groundpiece_obj.cxx,1.9,1.10 plfobj.cxx,1.8,1.9 plfobj.hxx,1.7,1.8 status_line.cxx,1.6,1.7 thumb_cache.cxx,1.8,1.9 weather_obj.cxx,1.5,1.6 |
Date: |
4 Sep 2002 14:55:14 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/editor
In directory dark:/tmp/cvs-serv11465/editor
Modified Files:
editor.cxx editor_event.cxx editor_groundpiece_obj.cxx
plfobj.cxx plfobj.hxx status_line.cxx thumb_cache.cxx
weather_obj.cxx
Log Message:
- removed traps
- various cleanup
Index: editor.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor.cxx,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- editor.cxx 23 Aug 2002 15:49:54 -0000 1.28
+++ editor.cxx 4 Sep 2002 14:55:12 -0000 1.29
@@ -45,7 +45,6 @@
#include "editor.hxx"
#include <cstdio>
-#include <string>
using namespace Pingus::Editor;
Index: editor_event.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/editor_event.cxx,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- editor_event.cxx 23 Aug 2002 15:49:54 -0000 1.30
+++ editor_event.cxx 4 Sep 2002 14:55:12 -0000 1.31
@@ -271,10 +271,10 @@
case CL_KEY_F9:
{
std::string tmp_str;
- char str[1024];
+ char str[16];
int theight, twidth;
- sprintf(str, "%d", object_manager->width);
+ snprintf(str, 16, "%d", object_manager->width);
tmp_str = editor->read_string("Input Width: ", str);
if (sscanf(tmp_str.c_str(), "%d", &twidth) == 1)
@@ -289,7 +289,7 @@
object_manager->width = twidth;
}
- sprintf(str, "%d", object_manager->height);
+ snprintf(str, 16, "%d", object_manager->height);
tmp_str = editor->read_string("Input Height: ", str);
if (sscanf(tmp_str.c_str(), "%d", &theight) == 1)
Index: editor_groundpiece_obj.cxx
===================================================================
RCS file:
/usr/local/cvsroot/Games/Pingus/src/editor/editor_groundpiece_obj.cxx,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- editor_groundpiece_obj.cxx 2 Jul 2002 13:36:06 -0000 1.9
+++ editor_groundpiece_obj.cxx 4 Sep 2002 14:55:12 -0000 1.10
@@ -38,11 +38,10 @@
std::string
EditorGroundpieceObj::status_line()
{
- // FIXME: This is a potential buffer overrun, to lazy to fix it right now
char str[1024];
std::string type_name = GroundpieceData::type_to_string(gptype);
- sprintf (str, "Groundpiece: %s Type: %s",
+ snprintf (str, 1024, "Groundpiece: %s Type: %s",
desc.res_name.c_str(), type_name.c_str());
return std::string(str);
Index: plfobj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/plfobj.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- plfobj.cxx 17 Aug 2002 17:56:23 -0000 1.8
+++ plfobj.cxx 4 Sep 2002 14:55:12 -0000 1.9
@@ -82,7 +82,7 @@
break;
}
- sprintf(str, "Entrance: %s Rate: %d Direction: %s Owner: %d",
+ snprintf(str, 256, "Entrance: %s Rate: %d Direction: %s Owner: %d",
type.c_str(), release_rate, dir_str.c_str(), owner_id);
return std::string(str);
@@ -122,7 +122,7 @@
{
char str[256];
- sprintf(str, "Exit - %s - X:%4.2f Y:%4.2f Z:%4.2f OwnerId: %d",
desc.res_name.c_str(), pos.x, pos.y, pos.z, owner_id);
+ snprintf(str, 256, "Exit - %s - X:%4.2f Y:%4.2f Z:%4.2f OwnerId: %d",
desc.res_name.c_str(), pos.x, pos.y, pos.z, owner_id);
return str;
}
@@ -226,9 +226,9 @@
std::string
LiquidObj::status_line()
{
- char str[256];
+ char str[32];
- sprintf(str, "%4.2f:%4.2f:%3.2f:%2d", pos.x, pos.y, pos.z, speed);
+ snprintf(str, 32, "%4.2f:%4.2f:%3.2f:%2d", pos.x, pos.y, pos.z, speed);
return std::string(str);
}
Index: plfobj.hxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/plfobj.hxx,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- plfobj.hxx 23 Aug 2002 15:49:54 -0000 1.7
+++ plfobj.hxx 4 Sep 2002 14:55:12 -0000 1.8
@@ -76,7 +76,6 @@
TrapObj operator= (const TrapObj&);
};
-///
class LiquidObj : public SpriteEditorObj,
protected LiquidData
{
Index: status_line.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/status_line.cxx,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- status_line.cxx 2 Jul 2002 13:36:07 -0000 1.6
+++ status_line.cxx 4 Sep 2002 14:55:12 -0000 1.7
@@ -40,7 +40,6 @@
StatusLine::draw(EditorView * view)
{
char mouse_co[256];
- // FIXME: This is a potential buffer overrun, to lazy to fix it right now
std::string status_line_text;
if (current_objs)
@@ -62,7 +61,7 @@
font->print_left(50, 5, status_line_text.c_str());
CL_Vector pos = view->screen_to_world(CL_Vector (CL_Mouse::get_x(),
CL_Mouse::get_y ()));
- sprintf(mouse_co, "X:%-3d Y:%-3d", int(pos.x), int(pos.y));
+ snprintf(mouse_co, 256, "X:%-3d Y:%-3d", static_cast<int>(pos.x),
static_cast<int>(pos.y));
font->print_left(CL_Display::get_width() - 100, 5, mouse_co);
}
Index: thumb_cache.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/thumb_cache.cxx,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- thumb_cache.cxx 17 Aug 2002 17:56:24 -0000 1.8
+++ thumb_cache.cxx 4 Sep 2002 14:55:12 -0000 1.9
@@ -18,7 +18,6 @@
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
-#include <iostream>
#include <ClanLib/Core/IOData/outputsource_file.h>
#include <ClanLib/Core/IOData/inputsource_file.h>
#include <ClanLib/Core/System/error.h>
Index: weather_obj.cxx
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editor/weather_obj.cxx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- weather_obj.cxx 2 Jul 2002 13:36:07 -0000 1.5
+++ weather_obj.cxx 4 Sep 2002 14:55:12 -0000 1.6
@@ -85,7 +85,7 @@
EditorObj*
WeatherObj::duplicate()
{
- return new WeatherObj(*this);
+ return new WeatherObj(static_cast<WeatherData>(*this));
}
void
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/editor editor.cxx,1.28,1.29 editor_event.cxx,1.30,1.31 editor_groundpiece_obj.cxx,1.9,1.10 plfobj.cxx,1.8,1.9 plfobj.hxx,1.7,1.8 status_line.cxx,1.6,1.7 thumb_cache.cxx,1.8,1.9 weather_obj.cxx,1.5,1.6,
torangan <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src/gui surface_button.cxx,1.3,1.4
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src/particles explosive_particle.cxx,1.1,1.2 particle.cxx,1.2,1.3 particle.hxx,1.3,1.4 pingu_particle.cxx,1.2,1.3 rain_particle.cxx,1.2,1.3 snow_particle.cxx,1.4,1.5
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src/gui surface_button.cxx,1.3,1.4
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src/particles explosive_particle.cxx,1.1,1.2 particle.cxx,1.2,1.3 particle.hxx,1.3,1.4 pingu_particle.cxx,1.2,1.3 rain_particle.cxx,1.2,1.3 snow_particle.cxx,1.4,1.5
- Index(es):