forked from 0ad/0ad
fix/disable warnings.
there are too many W4 and "potentially uninitialized", so those are disabled by 0ad_warning_disable.h. the silly "int x = strlen" and very dangerous "int x = (void*)p" (and vice versa) problems are fixed. This was SVN commit r5526.
This commit is contained in:
parent
8667ea74c8
commit
5bf9bca9ef
6
source/dcdt/se/0ad_warning_disable.h
Normal file
6
source/dcdt/se/0ad_warning_disable.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma warning(push, 3)
|
||||
|
||||
// it's way too much work to check all of these (runtime invariants may
|
||||
// ensure the code is safe but cannot automatically be proved by the
|
||||
// compiler)
|
||||
#pragma warning(disable:4701) // "potentially uninitialized variable"
|
@ -2,6 +2,7 @@
|
||||
|
||||
//DJD: Abstract function definitions {
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
#include <math.h>
|
||||
#include <fstream>
|
||||
|
@ -3,6 +3,7 @@
|
||||
//DJD: definition of FunnelNode functions {
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
#include "FunnelDeque.h"
|
||||
#include <float.h>
|
||||
|
@ -1,6 +1,7 @@
|
||||
//Location.cpp
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
#include <cstdlib>
|
||||
#include <math.h>
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
//DJD: Abstract space searching function definitions {
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
#include "se_dcdt.h"
|
||||
|
||||
|
@ -3,6 +3,7 @@
|
||||
//DJD: Helper function definitions {
|
||||
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
//DJD: Width function definitions {
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
#include "se_dcdt.h"
|
||||
#include <math.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "se.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include <math.h>
|
||||
# include <stdlib.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "se_dcdt.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "sr_array.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "sr_tree.h"
|
||||
# include "se_mesh_import.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include <string.h>
|
||||
# include "se_mesh.h"
|
||||
@ -8,7 +9,7 @@
|
||||
|
||||
//================================ IO =========================================
|
||||
|
||||
# define ID(se) int(se->_edge)
|
||||
# define ID(se) intptr_t(se->_edge)
|
||||
|
||||
void SeMeshBase::_elemsave ( SrOutput& out, SeMeshBase::ElemType type, SeElement* first )
|
||||
{
|
||||
@ -44,7 +45,8 @@ bool SeMeshBase::save ( SrOutput& out )
|
||||
{
|
||||
SeBase *se;
|
||||
SeElement *el, *eli;
|
||||
int symedges, i, j;
|
||||
int symedges, j;
|
||||
intptr_t i;
|
||||
|
||||
out << "SYMEDGE MESH DESCRIPTION\n\n";
|
||||
//fprintf ( f, "SYMEDGE MESH DESCRIPTION\n\n" );
|
||||
@ -159,7 +161,8 @@ void SeMeshBase::_elemload ( SrInput& inp, SrArray<SeElement*>& E,
|
||||
bool SeMeshBase::load ( SrInput& inp )
|
||||
{
|
||||
//char buf[64];
|
||||
int i, x;
|
||||
int i;
|
||||
intptr_t x;
|
||||
|
||||
//fscanf ( f, "%s", buf ); if ( strcmp(buf,"SYMEDGE") ) return false;
|
||||
//fscanf ( f, "%s", buf ); if ( strcmp(buf,"MESH") ) return false;
|
||||
@ -197,11 +200,11 @@ bool SeMeshBase::load ( SrInput& inp )
|
||||
|
||||
// convert indices to pointers:
|
||||
for ( i=0; i<S.size(); i++ )
|
||||
{ S[i]->_next = S[(int)(S[i]->_next)];
|
||||
S[i]->_rotate = S[(int)(S[i]->_rotate)];
|
||||
S[i]->_vertex = V[(int)(S[i]->_vertex)];
|
||||
S[i]->_edge = E[(int)(S[i]->_edge)];
|
||||
S[i]->_face = F[(int)(S[i]->_face)];
|
||||
{ S[i]->_next = S[(intptr_t)(S[i]->_next)];
|
||||
S[i]->_rotate = S[(intptr_t)(S[i]->_rotate)];
|
||||
S[i]->_vertex = V[(intptr_t)(S[i]->_vertex)];
|
||||
S[i]->_edge = E[(intptr_t)(S[i]->_edge)];
|
||||
S[i]->_face = F[(intptr_t)(S[i]->_face)];
|
||||
}
|
||||
|
||||
// adjust internal variables:
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include <stdlib.h>
|
||||
# include "se_mesh.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include <math.h>
|
||||
# include <stdlib.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdio.h>
|
||||
# include <string.h>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
|
||||
# include "sr.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_array_pt.h"
|
||||
|
||||
//====================== SrArrayPtBase ==========================
|
||||
@ -134,7 +135,7 @@ static SrClassManagerBase* StaticManager = 0; // This is not thread safe...
|
||||
|
||||
static int fcmp ( const void* pt1, const void* pt2 )
|
||||
{
|
||||
typedef const int* cint;
|
||||
typedef const intptr_t* cint;
|
||||
return StaticManager->compare( (const void*)*cint(pt1), (const void*)*cint(pt2) );
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "sr_box.h"
|
||||
# include "sr_mat.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
/* Note: this code was adapted from the PQP library;
|
||||
their copyright notice can be found at the end of this file. */
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_bv_coldet.h"
|
||||
|
||||
//============================= SrBvColdet::Object ===========================
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "precompiled.h"/* Note: this code was adapted from the PQP library;
|
||||
their copyright notice can be found at the end of this file. */
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include <math.h>
|
||||
# include <stdio.h>
|
||||
@ -512,8 +513,10 @@ void SrBvMath::Meigen ( srbvmat vout, srbvvec dout, srbvmat a )
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <float.h>
|
||||
#ifndef isnan
|
||||
#define isnan _isnan
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SegPoints()
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
# include "sr_bv_nbody.h"
|
||||
# include "sr_model.h"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "precompiled.h"/* Note: this code was adapted from the PQP library;
|
||||
their copyright notice can be found at the end of this file. */
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "sr_bv_tree.h"
|
||||
# include "sr_model.h"
|
||||
|
@ -1,5 +1,6 @@
|
||||
#include "precompiled.h"/* Note: this code was adapted from the PQP library;
|
||||
their copyright notice can be found at the end of this file. */
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "sr_bv_tree_query.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
# include "sr_box.h"
|
||||
# include "sr_plane.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_cfg_manager.h"
|
||||
|
||||
//=========================== SrCfgManagerBase ========================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_cfg_path.h"
|
||||
# include "sr_random.h"
|
||||
|
||||
@ -381,6 +382,7 @@ bool SrCfgPathBase::smooth_step ()
|
||||
{
|
||||
smooth_random ( _sprec, _slen );
|
||||
return false;
|
||||
#if 0
|
||||
int i, imax=1;
|
||||
int lasti = size()-2;
|
||||
float d;
|
||||
@ -425,6 +427,7 @@ return false;
|
||||
|
||||
if ( _sbads>6 ) return true; // no more easy improvements
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
SrOutput& operator<< ( SrOutput& o, const SrCfgPathBase& p )
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_cfg_planner.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // start
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_cfg_planner.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // not used
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_cfg_tree.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // expand node
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_color.h"
|
||||
|
||||
//========================================= static =======================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_cylinder.h"
|
||||
# include "sr_box.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_euler.h"
|
||||
# include "sr_mat.h"
|
||||
# include <math.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_event.h"
|
||||
|
||||
//# define SR_USE_TRACE1
|
||||
|
@ -1,4 +1,6 @@
|
||||
#include "precompiled.h"//***************************************************************************
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
//***************************************************************************
|
||||
//
|
||||
// SrExpTABLE.H
|
||||
// By Marcelo Kallmann 08/98 - Brazil
|
||||
@ -60,7 +62,7 @@ static srFunc func_code ( const char *st )
|
||||
compfunc // compare function
|
||||
);
|
||||
if (!result) return srFuncUndefined;
|
||||
return (srFunc) ( ((int)result-(int)Functions)/sizeof(int) );
|
||||
return (srFunc) ( ((intptr_t)result-(intptr_t)Functions)/sizeof(int) );
|
||||
}
|
||||
|
||||
const char *SrExpTable::function_name ( int index )
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdio.h>
|
||||
# include <math.h>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
# include "sr_graph.h"
|
||||
# include "sr_heap.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_grid.h"
|
||||
|
||||
//============================ SrGridBase =================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_hash_table.h"
|
||||
|
||||
//================================ hash function =============================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <string.h>
|
||||
|
||||
# include "sr_image.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <ctype.h>
|
||||
@ -58,7 +59,7 @@ SrInput::SrInput ( const char *buff, char com )
|
||||
if ( buff )
|
||||
{ _cur.s = buff;
|
||||
_ini.s = buff;
|
||||
_size = strlen ( buff );
|
||||
_size = (int)strlen ( buff );
|
||||
_curline = 1;
|
||||
_type = (srbyte) TypeString;
|
||||
}
|
||||
@ -112,7 +113,7 @@ void SrInput::init ( const char *buff )
|
||||
if ( buff )
|
||||
{ _cur.s = buff;
|
||||
_ini.s = buff;
|
||||
_size = strlen ( buff );
|
||||
_size = (int)strlen ( buff );
|
||||
_curline = 1;
|
||||
_type = (srbyte) TypeString;
|
||||
}
|
||||
@ -284,7 +285,7 @@ void SrInput::rewind ()
|
||||
int SrInput::pos ()
|
||||
{
|
||||
if ( ISFILE ) return ((int)ftell(_cur.f)) - _ini.f;
|
||||
else if ( ISSTRING ) return ((sruint)_cur.s) - ((sruint)_ini.s);
|
||||
else if ( ISSTRING ) return _cur.s - _ini.s;
|
||||
else return 0;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_light.h"
|
||||
|
||||
//===================================== SrLight ================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
# include "sr_box.h"
|
||||
# include "sr_line.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_box.h"
|
||||
# include "sr_mat.h"
|
||||
# include "sr_vec2.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_list.h"
|
||||
|
||||
//============================ SrListBase =================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_list_node.h"
|
||||
|
||||
//=============================== SrListNode ================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
|
||||
# include "sr_mat.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_material.h"
|
||||
|
||||
//# define SR_USE_TRACE1
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <string.h>
|
||||
# include <math.h>
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <ctype.h>
|
||||
@ -54,7 +55,7 @@ void *sr_mem_control_alloc ( const char* type, char* file, int line, int size, v
|
||||
if ( !addr )
|
||||
{ //lineout ();
|
||||
output<<"\nsr_control_malloc: Zero Pointer Allocated!\n" <<
|
||||
"File:"<<file<<" Line:"<<line<<" Elem Size:"<<size<<" Address:"<<(int)addr<<'\n';
|
||||
"File:"<<file<<" Line:"<<line<<" Elem Size:"<<size<<" Address:"<<(intptr_t)addr<<'\n';
|
||||
//lineout ();
|
||||
}
|
||||
|
||||
@ -64,7 +65,7 @@ void *sr_mem_control_alloc ( const char* type, char* file, int line, int size, v
|
||||
}
|
||||
|
||||
// the following is to get rid of the full path of files (in visualc++):
|
||||
int i = strlen(file);
|
||||
int i = (int)strlen(file);
|
||||
file += (i-1);
|
||||
while ( i>0 && *file!='\\' && *file!='/' ) { file--; i--; }
|
||||
if ( i>0 ) file++;
|
||||
@ -110,7 +111,7 @@ void sr_memory_report ()
|
||||
|
||||
for ( int i=0; i<mem_data_size; i++ )
|
||||
{ srMemData &m = mem_data[i];
|
||||
output.putf ( "%3d: %-25s %-15s %-6d %-8d %d\n", i+1, m.file, m.type, m.line, m.size, (int)m.addr );
|
||||
output.putf ( "%3d: %-25s %-15s %-6d %-8d %d\n", i+1, m.file, m.type, m.line, m.size, (intptr_t)m.addr );
|
||||
}
|
||||
|
||||
output << srnl;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
|
||||
# include "sr_model.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_model.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // keyword tracking
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_string_array.h"
|
||||
# include "sr_model.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdarg.h>
|
||||
# include <stdlib.h>
|
||||
# include <stdio.h>
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_path_array.h"
|
||||
|
||||
//# define SR_USE_TRACE1
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_plane.h"
|
||||
|
||||
//============================== SrPlane ======================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_box.h"
|
||||
# include "sr_vec2.h"
|
||||
# include "sr_points.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
# include "sr_box.h"
|
||||
# include "sr_geo2.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_box.h"
|
||||
# include "sr_polygons.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
|
||||
# include "sr_quat.h"
|
||||
# include "sr_vec.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr.h"
|
||||
# include "sr_random.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
//# include <stdlib.h>
|
||||
|
||||
# include "sr_sa.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
//# include <stdlib.h>
|
||||
|
||||
# include "sr_sa_bbox.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sa_eps_export.h"
|
||||
# include "sr_sa_bbox.h"
|
||||
# include "sr_sn_shape.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
//# include <stdlib.h>
|
||||
|
||||
# include "sr_sn_editor.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sa_model_export.h"
|
||||
# include "sr_model.h"
|
||||
# include "sr_sn_shape.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
//# include <stdlib.h>
|
||||
|
||||
# include "sr_sa_render_mode.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
# include "sr_set.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sn.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // SrSn Const/Dest
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sn_editor.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // SrSn Const/Dest
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sn_group.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // Const/Dest
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
|
||||
# include "sr_sn_manipulator.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sn_matrix.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // Const/Dest
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sn_polygon_editor.h"
|
||||
|
||||
//============================ SrSnPolygonEditor ====================================
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sn_shape.h"
|
||||
|
||||
//# define SR_USE_TRACE1 // Const/Dest
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_sphere.h"
|
||||
# include "sr_box.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
//# include <math.h>
|
||||
# include "sr_spline.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <ctype.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
@ -77,7 +78,7 @@ SrString& SrString::set ( const char *st )
|
||||
{ if ( _capacity ) _data[0]=0;
|
||||
}
|
||||
else
|
||||
{ int size = strlen(st)+1;
|
||||
{ int size = (int)strlen(st)+1;
|
||||
if ( _capacity<size )
|
||||
{ if ( _data!=_empty ) delete[] _data;
|
||||
_capacity = size;
|
||||
@ -140,7 +141,7 @@ void SrString::compress ()
|
||||
{
|
||||
if ( !_capacity ) return;
|
||||
|
||||
int len = strlen(_data);
|
||||
int len = (int)strlen(_data);
|
||||
|
||||
if ( len+1==_capacity ) return; // is compressed
|
||||
|
||||
@ -194,7 +195,7 @@ void SrString::bounds ( int &xi, int &xf ) const
|
||||
void SrString::substring ( int inf, int sup )
|
||||
{
|
||||
int n=0;
|
||||
int max=strlen(_data)-1;
|
||||
int max=(int)strlen(_data)-1;
|
||||
|
||||
if ( max<0 ) return;
|
||||
if ( inf<0 ) inf=0;
|
||||
@ -206,21 +207,21 @@ void SrString::substring ( int inf, int sup )
|
||||
|
||||
char SrString::last_char () const
|
||||
{
|
||||
int len = strlen(_data);
|
||||
int len = (int)strlen(_data);
|
||||
if ( len==0 ) return 0;
|
||||
return _data[len-1];
|
||||
}
|
||||
|
||||
void SrString::last_char ( char c )
|
||||
{
|
||||
int len = strlen(_data);
|
||||
int len = (int)strlen(_data);
|
||||
if ( len==0 ) return;
|
||||
_data[len-1] = c;
|
||||
}
|
||||
|
||||
void SrString::get_substring ( SrString& s, int inf, int sup ) const
|
||||
{
|
||||
int max=strlen(_data)-1;
|
||||
int max=(int)strlen(_data)-1;
|
||||
if ( max<0 ) return;
|
||||
if ( sup<0 || sup>max ) sup=max;
|
||||
if ( inf<0 ) inf=0;
|
||||
@ -234,7 +235,7 @@ void SrString::get_substring ( SrString& s, int inf, int sup ) const
|
||||
int SrString::get_next_string ( SrString& s, int i ) const
|
||||
{
|
||||
int i1, i2;
|
||||
int max=strlen(_data)-1;
|
||||
int max=(int)strlen(_data)-1;
|
||||
|
||||
if ( max<0 ) return -1;
|
||||
if ( i<0 ) i=0;
|
||||
@ -267,7 +268,7 @@ void SrString::upper ()
|
||||
|
||||
int SrString::search ( char c ) const
|
||||
{
|
||||
int len = strlen(_data);
|
||||
int len = (int)strlen(_data);
|
||||
for ( int i=0; i<len; i++ ) if (_data[i]==c) return i;
|
||||
return -1;
|
||||
}
|
||||
@ -275,10 +276,10 @@ int SrString::search ( char c ) const
|
||||
int SrString::search ( const char *st, bool ci ) const
|
||||
{
|
||||
int cmp;
|
||||
int len = strlen(st);
|
||||
int len = (int)strlen(st);
|
||||
if ( len==0 ) return -1;
|
||||
|
||||
int last_index = strlen(_data)-len;
|
||||
int last_index = (int)strlen(_data)-len;
|
||||
for ( int i=0; i<=last_index; i++ )
|
||||
{ cmp = ci? sr_compare ( _data+i, st, len ) :
|
||||
sr_compare_cs ( _data+i, st, len );
|
||||
@ -414,7 +415,7 @@ bool SrString::make_valid_string ( const char* s )
|
||||
bool need_slash = false;
|
||||
|
||||
int i;
|
||||
int len = strlen ( s );
|
||||
int len = (int)strlen ( s );
|
||||
|
||||
if ( len==0 )
|
||||
need_quotes = true;
|
||||
@ -471,7 +472,7 @@ void SrString::append ( const char* st )
|
||||
char *tmp = 0;
|
||||
if ( st==_data ) { tmp=sr_string_new(st); st=tmp; }
|
||||
|
||||
int newlen = strlen(_data)+strlen(st);
|
||||
int newlen = (int)strlen(_data)+(int)strlen(st);
|
||||
|
||||
if ( newlen<_capacity )
|
||||
{ strcat(_data,st);
|
||||
@ -491,10 +492,10 @@ void SrString::insert ( int i, const char *st )
|
||||
if ( !st ) return;
|
||||
if ( i<0 ) i=0;
|
||||
|
||||
int len = strlen(_data);
|
||||
int len = (int)strlen(_data);
|
||||
if ( i>=len ) { append(st); return; }
|
||||
|
||||
int dp = strlen ( st );
|
||||
int dp = (int)strlen ( st );
|
||||
if ( !dp ) return;
|
||||
|
||||
int ns = len+dp+1;
|
||||
@ -516,7 +517,7 @@ void SrString::insert ( int i, const char *st )
|
||||
void SrString::remove ( int i, int dp )
|
||||
{
|
||||
if ( _data==_empty || dp<=0 ) return;
|
||||
int len = strlen(_data);
|
||||
int len = (int)strlen(_data);
|
||||
if ( i>=len || i<0 ) return;
|
||||
if ( i+dp>=len ) { _data[i]=0; return; }
|
||||
|
||||
@ -531,8 +532,8 @@ int SrString::replace ( const char* oldst, const char* newst, bool ci )
|
||||
|
||||
if ( i<0 ) return i; // not found
|
||||
|
||||
int oldlen = strlen(oldst);
|
||||
int newlen = newst? strlen(newst):0;
|
||||
int oldlen = (int)strlen(oldst);
|
||||
int newlen = newst? (int)strlen(newst):0;
|
||||
|
||||
if ( oldlen<newlen ) // open space
|
||||
{ SrString dif ( ' ', newlen-oldlen );
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_string_array.h"
|
||||
|
||||
//# define SR_USE_TRACE1
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_time.h"
|
||||
# include "sr_string.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
|
||||
# include "sr_trackball.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_tree.h"
|
||||
|
||||
//# define SR_USE_TRACE1
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
//# include <math.h>
|
||||
# include "sr_triangle.h"
|
||||
//# include "sr_vec2.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include "sr_random.h"
|
||||
# include "sr_geo2.h"
|
||||
# include "sr_triangulation.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <ctype.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
@ -378,7 +379,7 @@ SrOutput& operator<< ( SrOutput& o, const SrVar& v )
|
||||
|
||||
case 's': for ( i=0; i<s; i++ )
|
||||
{ outs(o,i,v._data[i].s,buf);
|
||||
len += strlen(v._data[i].s);
|
||||
len += (int)strlen(v._data[i].s);
|
||||
if (i<e)
|
||||
{ if ( len>80 ) { o<<srnl<<srtab; len=0; }
|
||||
else o<<srspc;
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <stdlib.h>
|
||||
# include "sr_var_table.h"
|
||||
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
# include "sr_vec.h"
|
||||
# include "sr_vec2.h"
|
||||
|
@ -1,4 +1,5 @@
|
||||
#include "precompiled.h"
|
||||
#include "0ad_warning_disable.h"
|
||||
# include <math.h>
|
||||
# include "sr_vec2.h"
|
||||
# include "sr_geo2.h"
|
||||
|
Loading…
Reference in New Issue
Block a user