mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-16 22:58:34 +00:00
Static cast floats in atof usages where the datatype is actually float to avoid windows compiler warnings
This commit is contained in:
@@ -17,6 +17,11 @@ use DBD::mysql;
|
||||
use JSON;
|
||||
my $json = new JSON();
|
||||
|
||||
if (!$ARGV[0]) {
|
||||
print "\@example perl ~/code/utils/scripts/generators/repository-generator.pl ~/server/ [table|all] [base|extended|all]\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
#############################################
|
||||
# args
|
||||
#############################################
|
||||
@@ -277,7 +282,11 @@ foreach my $table_to_generate (@tables) {
|
||||
$all_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atoi(row[%s]);\n", $column_name, $index);
|
||||
$find_one_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atoi(row[%s]);\n", $column_name, $index);
|
||||
}
|
||||
elsif ($data_type =~ /float|double|decimal/) {
|
||||
elsif ($data_type =~ /float/) {
|
||||
$all_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = static_cast<float>(atof(row[%s]));\n", $column_name, $index);
|
||||
$find_one_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = static_cast<float>(atof(row[%s]));\n", $column_name, $index);
|
||||
}
|
||||
elsif ($data_type =~ /double|decimal/) {
|
||||
$all_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atof(row[%s]);\n", $column_name, $index);
|
||||
$find_one_entries .= sprintf("\t\t\tentry.%-${longest_column_length}s = atof(row[%s]);\n", $column_name, $index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user