@@ -71,7 +71,10 @@ static REBREQ *Req_SIO;
71
71
**
72
72
***********************************************************************/
73
73
{
74
- Req_SIO -> data = b_cast ("\n" );
74
+ // !!! Don't put const literal directly into mutable Req_SIO->data
75
+ static REBYTE newline [] = "\n" ;
76
+
77
+ Req_SIO -> data = newline ;
75
78
Req_SIO -> length = 1 ;
76
79
Req_SIO -> actual = 0 ;
77
80
@@ -83,7 +86,7 @@ static REBREQ *Req_SIO;
83
86
84
87
/***********************************************************************
85
88
**
86
- */ static void Prin_OS_String (REBYTE * bp , REBINT len , REBOOL uni )
89
+ */ static void Prin_OS_String (const REBYTE * bp , REBINT len , REBOOL uni )
87
90
/*
88
91
** Print a string, but no line terminator or space.
89
92
**
@@ -141,7 +144,7 @@ static REBREQ *Req_SIO;
141
144
142
145
/***********************************************************************
143
146
**
144
- */ void Out_Str (REBYTE * bp , REBINT lines )
147
+ */ void Out_Str (const REBYTE * bp , REBINT lines )
145
148
/*
146
149
***********************************************************************/
147
150
{
@@ -206,18 +209,18 @@ static REBREQ *Req_SIO;
206
209
//RESET_SERIES(Trace_Buffer);
207
210
}
208
211
else {
209
- Out_Str ("backtrace not enabled" , 1 );
212
+ Out_Str (cb_cast ( "backtrace not enabled" ) , 1 );
210
213
}
211
214
}
212
215
213
216
214
217
/***********************************************************************
215
218
**
216
- */ void Debug_String (REBYTE * bp , REBINT len , REBOOL uni , REBINT lines )
219
+ */ void Debug_String (const REBYTE * bp , REBINT len , REBOOL uni , REBINT lines )
217
220
/*
218
221
***********************************************************************/
219
222
{
220
- REBUNI * up = ( REBUNI * ) bp ;
223
+ const REBUNI * up = cast ( const REBUNI * , bp ) ;
221
224
REBUNI uc ;
222
225
223
226
if (Trace_Limit > 0 ) {
@@ -245,19 +248,19 @@ static REBREQ *Req_SIO;
245
248
/*
246
249
***********************************************************************/
247
250
{
248
- Debug_String ("" , UNKNOWN , 0 , 1 );
251
+ Debug_String (cb_cast ( "" ) , UNKNOWN , 0 , 1 );
249
252
}
250
253
251
254
252
255
/***********************************************************************
253
256
**
254
- */ void Debug_Str (REBYTE * str )
257
+ */ void Debug_Str (const char * str )
255
258
/*
256
259
** Print a string followed by a newline.
257
260
**
258
261
***********************************************************************/
259
262
{
260
- Debug_String (str , UNKNOWN , 0 , 1 );
263
+ Debug_String (cb_cast ( str ) , UNKNOWN , 0 , 1 );
261
264
}
262
265
263
266
@@ -292,7 +295,7 @@ static REBREQ *Req_SIO;
292
295
/*
293
296
***********************************************************************/
294
297
{
295
- if (BYTE_SIZE (ser )) Debug_Str (BIN_HEAD (ser ));
298
+ if (BYTE_SIZE (ser )) Debug_Str (s_cast ( BIN_HEAD (ser ) ));
296
299
else Debug_Uni (ser );
297
300
}
298
301
@@ -308,9 +311,9 @@ static REBREQ *Req_SIO;
308
311
REBYTE buf [40 ];
309
312
310
313
Debug_String (str , UNKNOWN , 0 , 0 );
311
- Debug_String (" " , 1 , 0 , 0 );
314
+ Debug_String (cb_cast ( " " ) , 1 , 0 , 0 );
312
315
Form_Hex_Pad (buf , num , 8 );
313
- Debug_Str (buf );
316
+ Debug_Str (s_cast ( buf ) );
314
317
}
315
318
316
319
@@ -350,7 +353,7 @@ static REBREQ *Req_SIO;
350
353
**
351
354
***********************************************************************/
352
355
{
353
- Debug_Str (Get_Word_Name (word ));
356
+ Debug_Str (cs_cast ( Get_Word_Name (word ) ));
354
357
}
355
358
356
359
@@ -362,7 +365,7 @@ static REBREQ *Req_SIO;
362
365
**
363
366
***********************************************************************/
364
367
{
365
- if (VAL_TYPE (value ) < REB_MAX ) Debug_Str (Get_Type_Name (value ));
368
+ if (VAL_TYPE (value ) < REB_MAX ) Debug_Str (cs_cast ( Get_Type_Name (value ) ));
366
369
else Debug_Str ("TYPE?!" );
367
370
}
368
371
0 commit comments