Remove the warning by type casting

Use explicit type casting to avoid the warning.