Skip to content

Commit c918a29

Browse files
authored
Merge pull request TTimo#352 from Pan7/Sys_FPrintf
Using Sys_FPrintf with SYS_WRN and SYS_ERR
2 parents 9cb253c + 5105fc5 commit c918a29

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+273
-271
lines changed

contrib/bobtoolz/DBrush.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ int DBrush::BuildPoints(){
8383
int pos = PointPosition( pnt );
8484

8585
if ( pos == POINT_IN_BRUSH ) { // ???? shouldn't happen here
86-
Sys_Printf( "ERROR:: Build Brush Points: Point IN brush!!!\n" );
86+
Sys_FPrintf( SYS_ERR, "ERROR:: Build Brush Points: Point IN brush!!!\n" );
8787
}
8888
else if ( pos == POINT_ON_BRUSH ) { // normal point
8989
if ( !HasPoint( pnt ) ) {

contrib/bobtoolz/cportals.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -122,31 +122,31 @@ void CPortals::Load(){
122122
in = fopen( fn, "rt" );
123123

124124
if ( in == NULL ) {
125-
Sys_Printf( " ERROR - could not open file.\n" );
125+
Sys_FPrintf( SYS_ERR, "ERROR - could not open file.\n" );
126126

127127
return;
128128
}
129129

130130
if ( !fgets( buf, LINE_BUF, in ) ) {
131131
fclose( in );
132132

133-
Sys_Printf( " ERROR - File ended prematurely.\n" );
133+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
134134

135135
return;
136136
}
137137

138138
if ( strncmp( "PRT1", buf, 4 ) != 0 ) {
139139
fclose( in );
140140

141-
Sys_Printf( " ERROR - File header indicates wrong file type (should be \"PRT1\").\n" );
141+
Sys_FPrintf( SYS_ERR, "ERROR - File header indicates wrong file type (should be \"PRT1\").\n" );
142142

143143
return;
144144
}
145145

146146
if ( !fgets( buf, LINE_BUF, in ) ) {
147147
fclose( in );
148148

149-
Sys_Printf( " ERROR - File ended prematurely.\n" );
149+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
150150

151151
return;
152152
}
@@ -158,7 +158,7 @@ void CPortals::Load(){
158158

159159
node_count = 0;
160160

161-
Sys_Printf( " ERROR - Extreme number of nodes, aborting.\n" );
161+
Sys_FPrintf( SYS_ERR, "ERROR - Extreme number of nodes, aborting.\n" );
162162

163163
return;
164164
}
@@ -168,7 +168,7 @@ void CPortals::Load(){
168168

169169
node_count = 0;
170170

171-
Sys_Printf( " ERROR - File ended prematurely.\n" );
171+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
172172

173173
return;
174174
}
@@ -181,7 +181,7 @@ void CPortals::Load(){
181181

182182
node_count = 0;
183183

184-
Sys_Printf( " ERROR - File ended prematurely.\n" );
184+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
185185

186186
return;
187187
}
@@ -199,7 +199,7 @@ void CPortals::Load(){
199199

200200
node_count = 0;
201201

202-
Sys_Printf( " ERROR - File ended prematurely.\n" );
202+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
203203

204204
return;
205205
}
@@ -218,7 +218,7 @@ void CPortals::Load(){
218218

219219
node_count = 0;
220220

221-
Sys_Printf( " ERROR - File ended prematurely.\n" );
221+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
222222

223223
return;
224224
}
@@ -249,7 +249,7 @@ void CPortals::Load(){
249249

250250
Purge();
251251

252-
Sys_Printf( " ERROR - Could not find information for portal number %d of %d.\n", n + 1, p_count );
252+
Sys_FPrintf( SYS_ERR, "ERROR - Could not find information for portal number %d of %d.\n", n + 1, p_count );
253253

254254
return;
255255
}
@@ -262,7 +262,7 @@ void CPortals::Load(){
262262

263263
Purge();
264264

265-
Sys_Printf( " ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count );
265+
Sys_FPrintf( SYS_ERR, "ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count );
266266

267267
return;
268268
}
@@ -272,7 +272,7 @@ void CPortals::Load(){
272272

273273
Purge();
274274

275-
Sys_Printf( " ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count );
275+
Sys_FPrintf( SYS_ERR, "ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count );
276276

277277
return;
278278
}
@@ -285,7 +285,7 @@ void CPortals::Load(){
285285

286286
Purge();
287287

288-
Sys_Printf( " ERROR - Could not find information for portal number %d of %d.\n", n + 1, p_count );
288+
Sys_FPrintf( SYS_ERR, "ERROR - Could not find information for portal number %d of %d.\n", n + 1, p_count );
289289

290290
return;
291291
}
@@ -298,7 +298,7 @@ void CPortals::Load(){
298298

299299
Purge();
300300

301-
Sys_Printf( " ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count );
301+
Sys_FPrintf( SYS_ERR, "ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, p_count );
302302

303303
return;
304304
}

contrib/bobtoolz/misc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void Sys_ERROR( const char* text, ... ){
143143
vsprintf( buf, text,argptr );
144144
va_end( argptr );
145145

146-
Sys_Printf( "BobToolz::ERROR->%s", buf );
146+
Sys_FPrintf( SYS_ERR, "BobToolz::ERROR->%s", buf );
147147
}
148148

149149
/*void Sys_Printf (char *text, ...)

contrib/camera/misc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void Sys_ERROR( char* text, ... ){
3434
vsprintf( buf, text,argptr );
3535
va_end( argptr );
3636

37-
Sys_Printf( "Camera::ERROR->%s", buf );
37+
Sys_FPrintf( SYS_ERR, "Camera::ERROR->%s", buf );
3838
}
3939

4040
char* UnixToDosPath( char* path ){
@@ -117,7 +117,7 @@ void CDECL Com_Error( int level, const char *error, ... ){
117117
vsprintf( buf, error,argptr );
118118
va_end( argptr );
119119

120-
Sys_Printf( "Camera::ERROR->%s", buf );
120+
Sys_FPrintf( SYS_ERR, "Camera::ERROR->%s", buf );
121121
}
122122

123123
void CDECL Com_Printf( const char* msg, ... ){

contrib/hydratoolz/plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void UpdateWadKeyPair( void ){
305305
}
306306
else
307307
{
308-
Sys_Printf( "HydraToolz: WARNING: could not locate wad file %s\n",(char *)wadlist->data );
308+
Sys_FPrintf( SYS_WRN, "WARNING: could not locate wad file %s\n",(char *)wadlist->data );
309309
strcat( wads, (char *)wadlist->data );
310310
}
311311
}

contrib/prtview/portals.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,31 +166,31 @@ void CPortals::Load(){
166166
in = fopen( fn, "rt" );
167167

168168
if ( in == NULL ) {
169-
Sys_Printf( " ERROR - could not open file.\n" );
169+
Sys_FPrintf( SYS_ERR, "ERROR - could not open file.\n" );
170170

171171
return;
172172
}
173173

174174
if ( !fgets( buf, LINE_BUF, in ) ) {
175175
fclose( in );
176176

177-
Sys_Printf( " ERROR - File ended prematurely.\n" );
177+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
178178

179179
return;
180180
}
181181

182182
if ( strncmp( "PRT1", buf, 4 ) != 0 ) {
183183
fclose( in );
184184

185-
Sys_Printf( " ERROR - File header indicates wrong file type (should be \"PRT1\").\n" );
185+
Sys_FPrintf( SYS_ERR, "ERROR - File header indicates wrong file type (should be \"PRT1\").\n" );
186186

187187
return;
188188
}
189189

190190
if ( !fgets( buf, LINE_BUF, in ) ) {
191191
fclose( in );
192192

193-
Sys_Printf( " ERROR - File ended prematurely.\n" );
193+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
194194

195195
return;
196196
}
@@ -203,7 +203,7 @@ void CPortals::Load(){
203203
204204
node_count = 0;
205205
206-
Sys_Printf(" ERROR - Extreme number of nodes, aborting.\n");
206+
Sys_FPrintf( SYS_ERR, "ERROR - Extreme number of nodes, aborting.\n");
207207
208208
return;
209209
}
@@ -214,7 +214,7 @@ void CPortals::Load(){
214214

215215
node_count = 0;
216216

217-
Sys_Printf( " ERROR - File ended prematurely.\n" );
217+
Sys_FPrintf( SYS_ERR, "ERROR - File ended prematurely.\n" );
218218

219219
return;
220220
}
@@ -227,7 +227,7 @@ void CPortals::Load(){
227227
portal_count = 0;
228228
node_count = 0;
229229

230-
Sys_Printf( " ERROR - Extreme number of portals, aborting.\n" );
230+
Sys_FPrintf( SYS_ERR, "ERROR - Extreme number of portals, aborting.\n" );
231231

232232
return;
233233
}
@@ -238,7 +238,7 @@ void CPortals::Load(){
238238
portal_count = 0;
239239
node_count = 0;
240240

241-
Sys_Printf( " ERROR - number of portals equals 0, aborting.\n" );
241+
Sys_FPrintf( SYS_ERR, "ERROR - number of portals equals 0, aborting.\n" );
242242

243243
return;
244244
}
@@ -260,7 +260,7 @@ void CPortals::Load(){
260260

261261
Purge();
262262

263-
Sys_Printf( " ERROR - Could not find information for portal number %d of %d.\n", n + 1, portal_count );
263+
Sys_FPrintf( SYS_ERR, "ERROR - Could not find information for portal number %d of %d.\n", n + 1, portal_count );
264264

265265
return;
266266
}
@@ -278,7 +278,7 @@ void CPortals::Load(){
278278

279279
Purge();
280280

281-
Sys_Printf( " ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, portal_count );
281+
Sys_FPrintf( SYS_ERR, "ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, portal_count );
282282

283283
return;
284284
}

plugins/eclassfgd/plugin.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -402,12 +402,12 @@ void EClass_ImportFromClass( eclass_t *e, GSList *l_classes, class_t *bc ){
402402

403403
// make sure we don't request ourself!
404404
if ( rbc == bc ) {
405-
Sys_Printf( "WARNING: baseclass '%s' tried to request itself!\n", bclst->data );
405+
Sys_FPrintf( SYS_WRN, "WARNING: baseclass '%s' tried to request itself!\n", bclst->data );
406406
}
407407
else
408408
{
409409
if ( !rbc ) {
410-
Sys_Printf( "WARNING: could not find the requested baseclass '%s' when building '%s'\n", requestedclass,bc->classname );
410+
Sys_FPrintf( SYS_WRN, "WARNING: could not find the requested baseclass '%s' when building '%s'\n", requestedclass,bc->classname );
411411
}
412412
else
413413
{
@@ -494,7 +494,7 @@ void EClass_ImportFromClass( eclass_t *e, GSList *l_classes, class_t *bc ){
494494
}
495495
else
496496
{
497-
Sys_Printf( "WARNING: baseclass '%s' has a spawnflag out of range, ignored!\n", bc->classname );
497+
Sys_FPrintf( SYS_WRN, "WARNING: baseclass '%s' has a spawnflag out of range, ignored!\n", bc->classname );
498498
}
499499
}
500500
break;
@@ -1015,7 +1015,7 @@ void Eclass_ScanFile( char *filename ){
10151015
}
10161016
else
10171017
{
1018-
Sys_Printf( "%WARNING: Parse error occured in '%s - %s'\n",classnames[newclass->classtype],newclass->classname );
1018+
Sys_FPrintf( SYS_WRN, "WARNING: Parse error occured in '%s - %s'\n",classnames[newclass->classtype],newclass->classname );
10191019
Free_Option( newoption );
10201020
}
10211021

plugins/entity/eclassmodel.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void CEntityEclassModel::UpdateCachedData(){
152152
m4x4_pivoted_transform_by_vec3( m_transform, m_translate, m_euler, eXYZ, m_scale, m_pivot );
153153
memcpy( m_inverse_transform, m_transform, sizeof( m4x4_t ) );
154154
if ( m4x4_invert( m_inverse_transform ) == 1 ) {
155-
Sys_Printf( "ERROR: Singular Matrix, cannot invert" );
155+
Sys_FPrintf( SYS_ERR, "ERROR: Singular Matrix, cannot invert" );
156156
}
157157

158158
if ( m_eclass ) {

plugins/entity/entity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ epair_t** Entity_GetKeyValList( entity_t *e ){
326326

327327
void Entity_SetKeyValList( entity_t *e, epair_t* ep ){
328328
if ( e->epairs ) {
329-
Sys_Printf( "Warning : pe->epairs != NULL in Entity_SetKeyValList, will not set\n" );
329+
Sys_FPrintf( SYS_WRN, "Warning : pe->epairs != NULL in Entity_SetKeyValList, will not set\n" );
330330
}
331331
else {
332332
e->epairs = ep;

plugins/imagehl/lbmlib.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ static void LoadIDSP( const char *name, byte ** pic, int *width, int *height ){
148148
header = (dspriteheader_t *)buffer;
149149

150150
if ( header->ident != IDSPRITEHEADER ) {
151-
Sys_Printf( "WARNING: %s has wrong header\n" );
151+
Sys_FPrintf( SYS_WRN, "WARNING: %s has wrong header\n" );
152152
vfsFreeFile( buffer );
153153
return;
154154
}
155155

156156
version = header->version;
157157
if ( version != 1 && version != 2 ) {
158-
Sys_Printf( "WARNING: %s has wrong version number "
158+
Sys_FPrintf( SYS_WRN, "WARNING: %s has wrong version number "
159159
"(%i should be 1 or 2)\n", name, version );
160160
vfsFreeFile( buffer );
161161
return;
@@ -180,7 +180,7 @@ static void LoadIDSP( const char *name, byte ** pic, int *width, int *height ){
180180
break;
181181
}
182182
if ( numframes > 1 ) {
183-
Sys_Printf( "WARNING: %s has multiple frames, only the first frame will be used.\n", name );
183+
Sys_FPrintf( SYS_WRN, "WARNING: %s has multiple frames, only the first frame will be used.\n", name );
184184
}
185185

186186
// palette = buffer+mipdatasize+2;

0 commit comments

Comments
 (0)