Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YGOPRO-520DIY
ygopro
Commits
9d479487
Commit
9d479487
authored
Mar 10, 2025
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace strtol
parent
c26191b6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
41 deletions
+41
-41
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+40
-40
No files found.
gframe/deck_manager.cpp
View file @
9d479487
...
@@ -196,7 +196,7 @@ int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_pa
...
@@ -196,7 +196,7 @@ int DeckManager::LoadDeck(Deck& deck, std::istringstream& deckStream, bool is_pa
if
(
linebuf
[
0
]
<
'0'
||
linebuf
[
0
]
>
'9'
)
if
(
linebuf
[
0
]
<
'0'
||
linebuf
[
0
]
>
'9'
)
continue
;
continue
;
errno
=
0
;
errno
=
0
;
code
=
strtol
(
linebuf
.
c_str
(),
nullptr
,
10
);
code
=
st
d
::
st
rtol
(
linebuf
.
c_str
(),
nullptr
,
10
);
if
(
errno
==
ERANGE
)
if
(
errno
==
ERANGE
)
continue
;
continue
;
cardlist
[
ct
++
]
=
code
;
cardlist
[
ct
++
]
=
code
;
...
...
gframe/game.cpp
View file @
9d479487
...
@@ -1345,13 +1345,13 @@ void Game::LoadConfig() {
...
@@ -1345,13 +1345,13 @@ void Game::LoadConfig() {
if
(
std
::
sscanf
(
linebuf
,
"%63s = %959s"
,
strbuf
,
valbuf
)
!=
2
)
if
(
std
::
sscanf
(
linebuf
,
"%63s = %959s"
,
strbuf
,
valbuf
)
!=
2
)
continue
;
continue
;
if
(
!
std
::
strcmp
(
strbuf
,
"antialias"
))
{
if
(
!
std
::
strcmp
(
strbuf
,
"antialias"
))
{
gameConf
.
antialias
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
antialias
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_d3d"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_d3d"
))
{
gameConf
.
use_d3d
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
use_d3d
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_scale"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_image_scale"
))
{
gameConf
.
use_image_scale
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
use_image_scale
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"errorlog"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"errorlog"
))
{
unsigned
int
val
=
strtol
(
valbuf
,
nullptr
,
10
);
unsigned
int
val
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
enable_log
=
val
&
0xff
;
enable_log
=
val
&
0xff
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"textfont"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"textfont"
))
{
int
textfontsize
=
0
;
int
textfontsize
=
0
;
...
@@ -1362,94 +1362,94 @@ void Game::LoadConfig() {
...
@@ -1362,94 +1362,94 @@ void Game::LoadConfig() {
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"numfont"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"numfont"
))
{
BufferIO
::
DecodeUTF8
(
valbuf
,
gameConf
.
numfont
);
BufferIO
::
DecodeUTF8
(
valbuf
,
gameConf
.
numfont
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"serverport"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"serverport"
))
{
gameConf
.
serverport
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
serverport
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"lasthost"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"lasthost"
))
{
BufferIO
::
DecodeUTF8
(
valbuf
,
gameConf
.
lasthost
);
BufferIO
::
DecodeUTF8
(
valbuf
,
gameConf
.
lasthost
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"lastport"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"lastport"
))
{
BufferIO
::
DecodeUTF8
(
valbuf
,
gameConf
.
lastport
);
BufferIO
::
DecodeUTF8
(
valbuf
,
gameConf
.
lastport
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"automonsterpos"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"automonsterpos"
))
{
gameConf
.
chkMAutoPos
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkMAutoPos
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"autospellpos"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"autospellpos"
))
{
gameConf
.
chkSTAutoPos
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkSTAutoPos
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"randompos"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"randompos"
))
{
gameConf
.
chkRandomPos
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkRandomPos
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"autochain"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"autochain"
))
{
gameConf
.
chkAutoChain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkAutoChain
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"waitchain"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"waitchain"
))
{
gameConf
.
chkWaitChain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkWaitChain
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"showchain"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"showchain"
))
{
gameConf
.
chkDefaultShowChain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkDefaultShowChain
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"mute_opponent"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"mute_opponent"
))
{
gameConf
.
chkIgnore1
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkIgnore1
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"mute_spectators"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"mute_spectators"
))
{
gameConf
.
chkIgnore2
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkIgnore2
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_lflist"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"use_lflist"
))
{
gameConf
.
use_lflist
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
use_lflist
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"default_lflist"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"default_lflist"
))
{
gameConf
.
default_lflist
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
default_lflist
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"default_rule"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"default_rule"
))
{
gameConf
.
default_rule
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
default_rule
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
if
(
gameConf
.
default_rule
<=
0
)
if
(
gameConf
.
default_rule
<=
0
)
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
gameConf
.
default_rule
=
DEFAULT_DUEL_RULE
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"hide_setname"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"hide_setname"
))
{
gameConf
.
hide_setname
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
hide_setname
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"hide_hint_button"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"hide_hint_button"
))
{
gameConf
.
hide_hint_button
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
hide_hint_button
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"control_mode"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"control_mode"
))
{
gameConf
.
control_mode
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
control_mode
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"draw_field_spell"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"draw_field_spell"
))
{
gameConf
.
draw_field_spell
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
draw_field_spell
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"separate_clear_button"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"separate_clear_button"
))
{
gameConf
.
separate_clear_button
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
separate_clear_button
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"auto_search_limit"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"auto_search_limit"
))
{
gameConf
.
auto_search_limit
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
auto_search_limit
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"search_multiple_keywords"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"search_multiple_keywords"
))
{
gameConf
.
search_multiple_keywords
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
search_multiple_keywords
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"ignore_deck_changes"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"ignore_deck_changes"
))
{
gameConf
.
chkIgnoreDeckChanges
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
chkIgnoreDeckChanges
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"default_ot"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"default_ot"
))
{
gameConf
.
defaultOT
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
defaultOT
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"enable_bot_mode"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"enable_bot_mode"
))
{
gameConf
.
enable_bot_mode
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
enable_bot_mode
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"quick_animation"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"quick_animation"
))
{
gameConf
.
quick_animation
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
quick_animation
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"auto_save_replay"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"auto_save_replay"
))
{
gameConf
.
auto_save_replay
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
auto_save_replay
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"draw_single_chain"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"draw_single_chain"
))
{
gameConf
.
draw_single_chain
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
draw_single_chain
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"hide_player_name"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"hide_player_name"
))
{
gameConf
.
hide_player_name
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
hide_player_name
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"prefer_expansion_script"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"prefer_expansion_script"
))
{
gameConf
.
prefer_expansion_script
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
prefer_expansion_script
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"window_maximized"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"window_maximized"
))
{
gameConf
.
window_maximized
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
window_maximized
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"window_width"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"window_width"
))
{
gameConf
.
window_width
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
window_width
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"window_height"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"window_height"
))
{
gameConf
.
window_height
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
window_height
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"resize_popup_menu"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"resize_popup_menu"
))
{
gameConf
.
resize_popup_menu
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
resize_popup_menu
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
)
>
0
;
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"enable_sound"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"enable_sound"
))
{
gameConf
.
enable_sound
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
enable_sound
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"sound_volume"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"sound_volume"
))
{
int
vol
=
strtol
(
valbuf
,
nullptr
,
10
);
int
vol
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
if
(
vol
<
0
)
if
(
vol
<
0
)
vol
=
0
;
vol
=
0
;
else
if
(
vol
>
100
)
else
if
(
vol
>
100
)
vol
=
100
;
vol
=
100
;
gameConf
.
sound_volume
=
(
double
)
vol
/
100
;
gameConf
.
sound_volume
=
(
double
)
vol
/
100
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"enable_music"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"enable_music"
))
{
gameConf
.
enable_music
=
strtol
(
valbuf
,
nullptr
,
10
)
>
0
;
gameConf
.
enable_music
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
)
>
0
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"music_volume"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"music_volume"
))
{
int
vol
=
strtol
(
valbuf
,
nullptr
,
10
);
int
vol
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
if
(
vol
<
0
)
if
(
vol
<
0
)
vol
=
0
;
vol
=
0
;
else
if
(
vol
>
100
)
else
if
(
vol
>
100
)
vol
=
100
;
vol
=
100
;
gameConf
.
music_volume
=
(
double
)
vol
/
100
;
gameConf
.
music_volume
=
(
double
)
vol
/
100
;
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"music_mode"
))
{
}
else
if
(
!
std
::
strcmp
(
strbuf
,
"music_mode"
))
{
gameConf
.
music_mode
=
strtol
(
valbuf
,
nullptr
,
10
);
gameConf
.
music_mode
=
st
d
::
st
rtol
(
valbuf
,
nullptr
,
10
);
#endif
#endif
}
else
{
}
else
{
// options allowing multiple words
// options allowing multiple words
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment