4
4
2022.01.25 M.Kogan 初版開発開始
5
5
*/
6
6
7
- #include "ggbase .h"
7
+ #include "GG .h"
8
8
9
9
GGT_CON GG_CON ; // GG_CONワークの実体
10
10
@@ -276,7 +276,7 @@ GGT_CMD* gg_con_CmdSearchX(char *name) // コマンド名のサーチ(nameは途
276
276
//
277
277
//--------------------------------------------------------------------------
278
278
279
- static C_help (int argc , char * * argv )
279
+ static int C_help (int argc , char * * argv )
280
280
{
281
281
int i ;
282
282
if (argc > 1 ) {
@@ -289,12 +289,14 @@ static C_help(int argc, char **argv)
289
289
return 0 ;
290
290
}
291
291
292
+ #if 0
292
293
static int C_quit (int argc , char * * argv ) // 終了(EXITコード発行)
293
294
{
294
295
if (argc == 1 ) return GG_CON_EXIT ; // EXITコード(-999)
295
296
gg_con_CmdHelp (argv [0 ]);
296
297
return 0 ;
297
298
}
299
+ #endif
298
300
299
301
//
300
302
// メモリダンプ系
@@ -324,7 +326,7 @@ static int mdchar(void *buf, long len)
324
326
static int C_mdb (int argc , char * * argv ) // メモリダンプ(byte)
325
327
{
326
328
uint8_t buf [16 ];
327
- long i , j ;
329
+ unsigned long i , j ;
328
330
GG_CON .PreDetection = 0 ;
329
331
if (argc > 1 ) maddr = gg_asc2int (argv [1 ]);
330
332
if (argc > 2 ) malen = gg_asc2int (argv [2 ]);
@@ -333,7 +335,7 @@ static int C_mdb(int argc, char**argv) // メモリダンプ(byte)
333
335
for (j = 0 ; j < 16 ; j ++ ) {
334
336
if (j >=(malen - i )) break ;
335
337
if (j == 8 ) gg_PutC (' ' );
336
- gg_printf (" %02X" , buf [j ]= * (uint8_t * )(maddr + i + j ));
338
+ gg_printf (" %02X" , buf [j ]= * (uint8_t * )(( uintptr_t )( maddr + i + j ) ));
337
339
if (GG_CON .PreDetection ) goto owari ;
338
340
}
339
341
if (mdchar (buf , malen - i )) goto owari ;
@@ -345,7 +347,7 @@ static int C_mdb(int argc, char**argv) // メモリダンプ(byte)
345
347
static int C_mdw (int argc , char * * argv ) // メモリダンプ(word)
346
348
{
347
349
uint16_t buf [8 ];
348
- long i , j ;
350
+ unsigned long i , j ;
349
351
if (argc > 1 ) maddr = gg_asc2int (argv [1 ]);
350
352
if (argc > 2 ) malen = gg_asc2int (argv [2 ]);
351
353
GG_CON .PreDetection = 0 ;
@@ -354,7 +356,7 @@ static int C_mdw(int argc, char**argv) // メモリダンプ(word)
354
356
for (j = 0 ; j < 16 ; j += 2 ) {
355
357
if (j >=(malen - i )) break ;
356
358
if (j == 8 ) gg_PutC (' ' );
357
- gg_printf (" %04X" , buf [j /2 ]= * (uint16_t * )(maddr + i + j ));
359
+ gg_printf (" %04X" , buf [j /2 ]= * (uint16_t * )(( uintptr_t )( maddr + i + j ) ));
358
360
if (GG_CON .PreDetection ) goto owari ;
359
361
}
360
362
if (mdchar (buf , malen - i )) goto owari ;
@@ -366,7 +368,7 @@ static int C_mdw(int argc, char**argv) // メモリダンプ(word)
366
368
static int C_mdd (int argc , char * * argv ) // メモリダンプ(dword)
367
369
{
368
370
uint32_t buf [8 ];
369
- long i , j ;
371
+ unsigned long i , j ;
370
372
if (argc > 1 ) maddr = gg_asc2int (argv [1 ]);
371
373
if (argc > 2 ) malen = gg_asc2int (argv [2 ]);
372
374
GG_CON .PreDetection = 0 ;
@@ -375,7 +377,7 @@ static int C_mdd(int argc, char**argv) // メモリダンプ(dword)
375
377
for (j = 0 ; j < 16 ; j += 4 ) {
376
378
if (j >=(malen - i )) break ;
377
379
if (j == 8 ) gg_PutC (' ' );
378
- gg_printf (" %08lX" , buf [j /4 ]= * (uint32_t * )(maddr + i + j ));
380
+ gg_printf (" %08lX" , buf [j /4 ]= * (uint32_t * )(( uintptr_t )( maddr + i + j ) ));
379
381
if (GG_CON .PreDetection ) goto owari ;
380
382
}
381
383
if (mdchar (buf , malen - i )) goto owari ;
@@ -393,7 +395,7 @@ static int C_msb(int argc, char**argv) // メモリセット(byte)
393
395
addr = gg_asc2int (argv [1 ]);
394
396
while (argc > 2 ) {
395
397
data = gg_asc2int (argv [2 ]);
396
- * (uint8_t * )(addr ) = (uint8_t )data ;
398
+ * (uint8_t * )(( uintptr_t ) addr ) = (uint8_t )data ;
397
399
addr += 1 ;
398
400
argc -- ;
399
401
argv ++ ;
@@ -411,7 +413,7 @@ static int C_msw(int argc, char**argv) // メモリセット(word)
411
413
addr = gg_asc2int (argv [1 ]);
412
414
while (argc > 2 ) {
413
415
data = gg_asc2int (argv [2 ]);
414
- * (uint16_t * )(addr ) = (uint16_t )data ;
416
+ * (uint16_t * )(( uintptr_t ) addr ) = (uint16_t )data ;
415
417
addr += 2 ;
416
418
argc -- ;
417
419
argv ++ ;
@@ -429,7 +431,7 @@ static int C_msd(int argc, char**argv) // メモリセット(dword)
429
431
addr = gg_asc2int (argv [1 ]);
430
432
while (argc > 2 ) {
431
433
data = gg_asc2int (argv [2 ]);
432
- * (uint32_t * )(addr ) = (uint32_t )data ;
434
+ * (uint32_t * )(( uintptr_t ) addr ) = (uint32_t )data ;
433
435
addr += 4 ;
434
436
argc -- ;
435
437
argv ++ ;
@@ -451,7 +453,7 @@ static int C_mfb(int argc, char**argv) // メモリフィル(byte)
451
453
alen = gg_asc2int (argv [2 ]);
452
454
data = gg_asc2int (argv [3 ]);
453
455
for (i = 0 ; i < alen ; i += 1 ) {
454
- * (uint8_t * )(addr + i ) = (uint8_t )data ;
456
+ * (uint8_t * )(( uintptr_t )( addr + i ) ) = (uint8_t )data ;
455
457
}
456
458
} else {
457
459
gg_con_CmdHelp (argv [0 ]);
@@ -469,7 +471,7 @@ static int C_mfw(int argc, char**argv) // メモリフィル(word)
469
471
alen = gg_asc2int (argv [2 ]);
470
472
data = gg_asc2int (argv [3 ]);
471
473
for (i = 0 ; i < alen ; i += 2 ) {
472
- * (uint16_t * )(addr + i ) = (uint16_t )data ;
474
+ * (uint16_t * )(( uintptr_t )( addr + i ) ) = (uint16_t )data ;
473
475
}
474
476
} else {
475
477
gg_con_CmdHelp (argv [0 ]);
@@ -487,7 +489,7 @@ static int C_mfd(int argc, char**argv) // メモリフィル(dword)
487
489
alen = gg_asc2int (argv [2 ]);
488
490
data = gg_asc2int (argv [3 ]);
489
491
for (i = 0 ; i < alen ; i += 4 ) {
490
- * (uint32_t * )(addr + i ) = (uint32_t )data ;
492
+ * (uint32_t * )(( uintptr_t )( addr + i ) ) = (uint32_t )data ;
491
493
}
492
494
} else {
493
495
gg_con_CmdHelp (argv [0 ]);
0 commit comments