• R/O
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

X operations(XOPS)に非常に近いFPSゲームを制作・リメイクし、成果物をオープンソースとして公開することを目的としたプロジェクトです。


Commit MetaInfo

Revision125 (tree)
Time2016-03-20 11:24:39
Authorxops-mikan

Log Message

文字列へのヌル文字代入を \0 へ統一

Change Summary

Incremental Difference

--- trunk/d3dgraphics-opengl.cpp (revision 124)
+++ trunk/d3dgraphics-opengl.cpp (revision 125)
@@ -309,7 +309,7 @@
309309
310310 //マジックコード取得
311311 fgets(buf, 256, fp);
312- buf[ strlen("xof 0302txt") ] = 0x00;
312+ buf[ strlen("xof 0302txt") ] = '\0';
313313 if( strcmp(buf, "xof 0302txt") != 0 ){
314314 fclose( fp );
315315 return -1; //Xファイルでない
@@ -317,7 +317,7 @@
317317
318318 while( fgets(buf, 256, fp) != NULL ){
319319 strcpy(str, buf);
320- str[ strlen("Mesh") ] = 0x00;
320+ str[ strlen("Mesh") ] = '\0';
321321 if( strcmp(str, "Mesh") == 0 ){
322322
323323 fgets(buf, 256, fp);
@@ -369,7 +369,7 @@
369369
370370 while( fgets(buf, 256, fp) != NULL ){
371371 strcpy(str, buf);
372- str[ strlen(" MeshTextureCoords") ] = 0x00;
372+ str[ strlen(" MeshTextureCoords") ] = '\0';
373373 if( strcmp(str, " MeshTextureCoords") == 0 ){
374374
375375 fgets(buf, 256, fp);
@@ -606,7 +606,7 @@
606606 for(int i=0; i<strlen(filename); i++){
607607 filename2[i] = (char)tolower(filename[i]);
608608 }
609- filename2[ strlen(filename) ] = NULL;
609+ filename2[ strlen(filename) ] = '\0';
610610
611611 //拡張子でファイルフォーマットを判定
612612 for(int i=strlen(filename2)-1; i>0; i--){
--- trunk/parameter.cpp (revision 124)
+++ trunk/parameter.cpp (revision 125)
@@ -39,15 +39,15 @@
3939 {
4040 Human = NULL;
4141 for(int i=0; i<TOTAL_HUMANTEXTURE; i++){
42- HumanTexturePath[i] = NULL;
42+ HumanTexturePath[i] = '\0';
4343 }
4444 Weapon = NULL;
4545 SmallObject = NULL;
4646 for(int i=0; i<TOTAL_OFFICIALMISSION; i++){
47- missionname[i] = NULL;
48- missionfullname[i] = NULL;
49- missiondirectory[i] = NULL;
50- missiontxt[i] = NULL;
47+ missionname[i] = '\0';
48+ missionfullname[i] = '\0';
49+ missiondirectory[i] = '\0';
50+ missiontxt[i] = '\0';
5151 }
5252 AIlevel = NULL;
5353 }
--- trunk/objectmanager.cpp (revision 124)
+++ trunk/objectmanager.cpp (revision 125)
@@ -2124,7 +2124,7 @@
21242124 int Player_teamID;
21252125
21262126 //文字を初期化
2127- infostr[0] = NULL;
2127+ infostr[0] = '\0';
21282128
21292129 //プレイヤーのチーム番号を取得
21302130 HumanIndex[Player_HumanID].GetParamData(NULL, NULL, NULL, &Player_teamID);
--- trunk/datafile.cpp (revision 124)
+++ trunk/datafile.cpp (revision 125)
@@ -365,7 +365,7 @@
365365 //イベントメッセージ初期化
366366 for(int i=0; i<MAX_POINTMESSAGES; i++){
367367 text[i] = new char[MAX_POINTMESSAGEBYTE];
368- text[i][0] = NULL;
368+ text[i][0] = '\0';
369369 }
370370 }
371371
@@ -453,7 +453,7 @@
453453 //PathRemoveExtension(fname2);
454454 for(int i=strlen(fname2)-1; i>0; i--){
455455 if( fname2[i] == '.' ){
456- fname2[i] = 0x00;
456+ fname2[i] = '\0';
457457 break;
458458 }
459459 }
@@ -1069,7 +1069,7 @@
10691069 for(int j=0; j<(int)strlen(mission_name[i]); j++){
10701070 mission_name_c[i][j] = (char)tolower(mission_name[i][j]);
10711071 }
1072- mission_name_c[i][strlen(mission_name[i])] = 0x00;
1072+ mission_name_c[i][strlen(mission_name[i])] = '\0';
10731073 }
10741074
10751075 //低速なバブルソート (^^;
--- trunk/gamemain.cpp (revision 124)
+++ trunk/gamemain.cpp (revision 125)
@@ -410,7 +410,7 @@
410410 //! @brief コンストラクタ
411411 mainmenu::mainmenu()
412412 {
413- demopath[0] = 0x00;
413+ demopath[0] = '\0';
414414 mainmenu_scrollitems_official = 0;
415415 mainmenu_scrollitems_addon = 0;
416416 }
@@ -1065,7 +1065,7 @@
10651065 strcpy(path, bdata);
10661066 for(int i=strlen(path)-1; i>0; i--){
10671067 if( path[i] == '\\' ){
1068- path[i+1] = 0x00;
1068+ path[i+1] = '\0';
10691069 break;
10701070 }
10711071 }
@@ -1155,10 +1155,10 @@
11551155 InputConsoleData = new ConsoleData;
11561156 for(int i=0; i<MAX_CONSOLELINES; i++){
11571157 InfoConsoleData[i].color = d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f);
1158- InfoConsoleData[i].textdata[0] = NULL;
1158+ InfoConsoleData[i].textdata[0] = '\0';
11591159 }
11601160 InputConsoleData->color = d3dg->GetColorCode(1.0f,1.0f,0.0f,1.0f);
1161- InputConsoleData->textdata[0] = NULL;
1161+ InputConsoleData->textdata[0] = '\0';
11621162 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), "Game Debug Console.");
11631163 AddInfoConsole(d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f), " Command list >help");
11641164 #endif
@@ -1186,7 +1186,7 @@
11861186 strcpy(path, bdata);
11871187 for(int i=strlen(path)-1; i>0; i--){
11881188 if( path[i] == '\\' ){
1189- path[i+1] = 0x00;
1189+ path[i+1] = '\0';
11901190 break;
11911191 }
11921192 }
@@ -2128,7 +2128,7 @@
21282128 //左下エリア描画
21292129 //"ウエエエエエエオ"
21302130 stru[0] = 0xB3; stru[1] = 0xB4; stru[2] = 0xB4; stru[3] = 0xB4; stru[4] = 0xB4;
2131- stru[5] = 0xB4; stru[6] = 0xB4; stru[7] = 0xB5; stru[8] = 0x00;
2131+ stru[5] = 0xB4; stru[6] = 0xB4; stru[7] = 0xB5; stru[8] = '\0';
21322132 d3dg->Draw2DTextureFontText(15, SCREEN_HEIGHT - 105, (char*)stru, d3dg->GetColorCode(1.0f,1.0f,1.0f,0.5f), 32, 32);
21332133 //"テトトトトトトナ"
21342134 for(int i=0; stru[i] != 0x00; i++){ stru[i] += 0x10; }
@@ -2135,7 +2135,7 @@
21352135 d3dg->Draw2DTextureFontText(15, SCREEN_HEIGHT - 105 +32, (char*)stru, d3dg->GetColorCode(1.0f,1.0f,1.0f,0.5f), 32, 32);
21362136 //"ウエエカキキキクケ"
21372137 stru[0] = 0xB3; stru[1] = 0xB4; stru[2] = 0xB4; stru[3] = 0xB6; stru[4] = 0xB7;
2138- stru[5] = 0xB7; stru[6] = 0xB7; stru[7] = 0xB8; stru[8] = 0xB9; stru[9] = 0x00;
2138+ stru[5] = 0xB7; stru[6] = 0xB7; stru[7] = 0xB8; stru[8] = 0xB9; stru[9] = '\0';
21392139 d3dg->Draw2DTextureFontText(15, SCREEN_HEIGHT - 55, (char*)stru, d3dg->GetColorCode(1.0f,1.0f,1.0f,0.5f), 32, 32);
21402140 //"テトトニヌヌヌネノ"
21412141 for(int i=0; stru[i] != 0x00; i++){ stru[i] += 0x10; }
@@ -2147,7 +2147,7 @@
21472147 stru[i] = 0xB1;//'ア';
21482148 }
21492149 stru[HUDA_WEAPON_SIZEW-1] = 0xB2;//'イ';
2150- stru[HUDA_WEAPON_SIZEW] = 0x00;
2150+ stru[HUDA_WEAPON_SIZEW] = '\0';
21512151
21522152 //右下エリア描画
21532153 d3dg->Draw2DTextureFontText(HUDA_WEAPON_POSX, HUDA_WEAPON_POSY, (char*)stru, d3dg->GetColorCode(1.0f,1.0f,1.0f,0.5f), 32, 32);
@@ -2267,9 +2267,9 @@
22672267 d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGHT/2-13, SCREEN_WIDTH/2, SCREEN_HEIGHT/2-3, d3dg->GetColorCode(1.0f,0.0f,0.0f,1.0f));
22682268 d3dg->Draw2DLine(SCREEN_WIDTH/2, SCREEN_HEIGHT/2+13, SCREEN_WIDTH/2, SCREEN_HEIGHT/2+3, d3dg->GetColorCode(1.0f,0.0f,0.0f,1.0f));
22692269
2270- stru[0] = 0xBD; stru[1] = 0x00; //"ス"
2270+ stru[0] = 0xBD; stru[1] = '\0'; //"ス"
22712271 d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 16 - ErrorRange, SCREEN_HEIGHT/2 - 16, (char*)stru, d3dg->GetColorCode(1.0f,0.0f,0.0f,0.5f), 32, 32);
2272- stru[0] = 0xBE; stru[1] = 0x00; //"セ"
2272+ stru[0] = 0xBE; stru[1] = '\0'; //"セ"
22732273 d3dg->Draw2DTextureFontText(SCREEN_WIDTH/2 - 16 + ErrorRange, SCREEN_HEIGHT/2 - 16, (char*)stru, d3dg->GetColorCode(1.0f,0.0f,0.0f,0.5f), 32, 32);
22742274 }
22752275 }
@@ -2586,9 +2586,9 @@
25862586 void maingame::ConsoleInputText(char inchar)
25872587 {
25882588 for(int i=0; i<MAX_CONSOLELEN; i++){
2589- if( InputConsoleData->textdata[i] == NULL ){
2589+ if( InputConsoleData->textdata[i] == '\0' ){
25902590 InputConsoleData->textdata[i] = inchar;
2591- InputConsoleData->textdata[i+1] = NULL;
2591+ InputConsoleData->textdata[i+1] = '\0';
25922592 return;
25932593 }
25942594 }
@@ -2599,7 +2599,7 @@
25992599 {
26002600 int s = strlen(InputConsoleData->textdata);
26012601 if( s == (int)strlen(CONSOLE_PROMPT) ){ return; }
2602- InputConsoleData->textdata[ s-1 ] = NULL;
2602+ InputConsoleData->textdata[ s-1 ] = '\0';
26032603 }
26042604
26052605 //! @brief コマンドの判定および引数(整数値)を取得
@@ -2612,7 +2612,7 @@
26122612
26132613 //コマンド名を調べる
26142614 strcpy(str, NewCommand);
2615- str[ strlen(cmd) ] = NULL;
2615+ str[ strlen(cmd) ] = '\0';
26162616 if( strcmp(str, cmd) != 0 ){ return false; }
26172617
26182618 //「コマンド名_X」分の文字数に達しているかどうか
@@ -2626,7 +2626,7 @@
26262626 //! @brief デバック用コンソールの入力処理
26272627 void maingame::InputConsole()
26282628 {
2629- NewCommand[0] = NULL;
2629+ NewCommand[0] = '\0';
26302630
26312631 if( inputCtrl->CheckKeyDown(OriginalkeycodeToDinputdef(0x0F)) ){ // [ENTER]
26322632 //何か入力されていれば〜
@@ -3079,7 +3079,7 @@
30793079 if( strcmp(NewCommand, "clear") == 0 ){
30803080 for(int i=0; i<MAX_CONSOLELINES; i++){
30813081 InfoConsoleData[i].color = d3dg->GetColorCode(1.0f,1.0f,1.0f,1.0f);
3082- InfoConsoleData[i].textdata[0] = NULL;
3082+ InfoConsoleData[i].textdata[0] = '\0';
30833083 }
30843084 }
30853085