mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 01:07:51 -04:00
explicit casts and other /W4 fixes
This commit is contained in:
parent
9d97d87db4
commit
565d3fb84f
@ -90,7 +90,7 @@ as_switch() {
|
|||||||
// is nonzero.
|
// is nonzero.
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
int DCPackerInterface::
|
int DCPackerInterface::
|
||||||
calc_num_nested_fields(size_t length_bytes) const {
|
calc_num_nested_fields(size_t) const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -103,7 +103,7 @@ calc_num_nested_fields(size_t length_bytes) const {
|
|||||||
// the range 0 <= n < get_num_nested_fields()).
|
// the range 0 <= n < get_num_nested_fields()).
|
||||||
////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////
|
||||||
DCPackerInterface *DCPackerInterface::
|
DCPackerInterface *DCPackerInterface::
|
||||||
get_nested_field(int n) const {
|
get_nested_field(int) const {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,7 +385,7 @@ type_name:
|
|||||||
if ($3 == 0) {
|
if ($3 == 0) {
|
||||||
yyerror("Invalid divisor.");
|
yyerror("Invalid divisor.");
|
||||||
|
|
||||||
} else if (!simple_param->set_divisor($3)) {
|
} else if (!simple_param->set_divisor((int)$3)) {
|
||||||
yyerror("A divisor is only valid on a numeric type.");
|
yyerror("A divisor is only valid on a numeric type.");
|
||||||
}
|
}
|
||||||
$$ = simple_param;
|
$$ = simple_param;
|
||||||
@ -396,7 +396,7 @@ type_name:
|
|||||||
if ($3 == 0) {
|
if ($3 == 0) {
|
||||||
yyerror("Invalid divisor.");
|
yyerror("Invalid divisor.");
|
||||||
|
|
||||||
} else if (!simple_param->set_divisor($3)) {
|
} else if (!simple_param->set_divisor((int)$3)) {
|
||||||
yyerror("A divisor is only valid on a numeric type.");
|
yyerror("A divisor is only valid on a numeric type.");
|
||||||
}
|
}
|
||||||
if (!simple_param->set_range(double_range)) {
|
if (!simple_param->set_range(double_range)) {
|
||||||
@ -410,7 +410,7 @@ type_name:
|
|||||||
if ($6 == 0) {
|
if ($6 == 0) {
|
||||||
yyerror("Invalid divisor.");
|
yyerror("Invalid divisor.");
|
||||||
|
|
||||||
} else if (!simple_param->set_divisor($6)) {
|
} else if (!simple_param->set_divisor((int)$6)) {
|
||||||
yyerror("A divisor is only valid on a numeric type.");
|
yyerror("A divisor is only valid on a numeric type.");
|
||||||
}
|
}
|
||||||
if (!simple_param->set_range(double_range)) {
|
if (!simple_param->set_range(double_range)) {
|
||||||
@ -500,7 +500,7 @@ uint_range:
|
|||||||
yyerror("Nonnegative values only");
|
yyerror("Nonnegative values only");
|
||||||
} else {
|
} else {
|
||||||
uint_range.clear();
|
uint_range.clear();
|
||||||
if (!uint_range.add_range($1, $1)) {
|
if (!uint_range.add_range((unsigned int)$1, (unsigned int)$1)) {
|
||||||
yyerror("Overlapping range");
|
yyerror("Overlapping range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -511,7 +511,7 @@ uint_range:
|
|||||||
yyerror("Nonnegative values only");
|
yyerror("Nonnegative values only");
|
||||||
} else {
|
} else {
|
||||||
uint_range.clear();
|
uint_range.clear();
|
||||||
if (!uint_range.add_range($1, $3)) {
|
if (!uint_range.add_range((unsigned int)$1, (unsigned int)$3)) {
|
||||||
yyerror("Overlapping range");
|
yyerror("Overlapping range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -523,7 +523,7 @@ uint_range:
|
|||||||
yyerror("Syntax error");
|
yyerror("Syntax error");
|
||||||
} else if ($1 < 0) {
|
} else if ($1 < 0) {
|
||||||
yyerror("Nonnegative values only");
|
yyerror("Nonnegative values only");
|
||||||
} else if (!uint_range.add_range($1, -$2)) {
|
} else if (!uint_range.add_range((unsigned int)$1, (unsigned int)-$2)) {
|
||||||
yyerror("Overlapping range");
|
yyerror("Overlapping range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -531,7 +531,7 @@ uint_range:
|
|||||||
{
|
{
|
||||||
if ($3 < 0) {
|
if ($3 < 0) {
|
||||||
yyerror("Nonnegative values only");
|
yyerror("Nonnegative values only");
|
||||||
} else if (!uint_range.add_range($3, $3)) {
|
} else if (!uint_range.add_range((unsigned int)$3, (unsigned int)$3)) {
|
||||||
yyerror("Overlapping range");
|
yyerror("Overlapping range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -539,7 +539,7 @@ uint_range:
|
|||||||
{
|
{
|
||||||
if ($3 < 0 || $5 < 0) {
|
if ($3 < 0 || $5 < 0) {
|
||||||
yyerror("Nonnegative values only");
|
yyerror("Nonnegative values only");
|
||||||
} else if (!uint_range.add_range($3, $5)) {
|
} else if (!uint_range.add_range((unsigned int)$3, (unsigned int)$5)) {
|
||||||
yyerror("Overlapping range");
|
yyerror("Overlapping range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -549,7 +549,7 @@ uint_range:
|
|||||||
yyerror("Syntax error");
|
yyerror("Syntax error");
|
||||||
} else if ($3 < 0) {
|
} else if ($3 < 0) {
|
||||||
yyerror("Nonnegative values only");
|
yyerror("Nonnegative values only");
|
||||||
} else if (!uint_range.add_range($3, -$4)) {
|
} else if (!uint_range.add_range((unsigned int)$3, (unsigned int)-$4)) {
|
||||||
yyerror("Overlapping range");
|
yyerror("Overlapping range");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -578,7 +578,7 @@ parameter_definition:
|
|||||||
yyerror("A divisor is only allowed on a primitive type.");
|
yyerror("A divisor is only allowed on a primitive type.");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if (!$1->as_simple_parameter()->set_divisor($3)) {
|
if (!$1->as_simple_parameter()->set_divisor((int)$3)) {
|
||||||
yyerror("A divisor is only valid on a numeric type.");
|
yyerror("A divisor is only valid on a numeric type.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user