1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

pidl: Fix unsigned integer comparison warning

bin/default/librpc/gen_ndr/py_wkssvc.c:27344:33: warning:
comparison of integer expressions of different signedness: ‘long int’
and ‘long long unsigned int’ [-Wsign-compare] <--[gcc]
    if (test_var < 0 || test_var > uint_max) {
                                 ^

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Dec 13 05:00:20 CET 2018 on sn-devel-144
This commit is contained in:
Andreas Schneider 2018-12-12 20:58:23 +01:00 committed by Andrew Bartlett
parent 5508c19c5c
commit 57783d6295

View File

@ -1726,7 +1726,7 @@ sub ConvertObjectFromPythonData($$$$$$;$$)
$self->indent;
$self->pidl("long test_var;");
$self->pidl("test_var = PyInt_AsLong($cvar);");
$self->pidl("if (test_var < 0 || test_var > uint_max) {");
$self->pidl("if (test_var < 0 || (unsigned long long)test_var > uint_max) {");
$self->indent;
$self->pidl("PyErr_Format(PyExc_OverflowError, \"Expected type %s or %s within range 0 - %llu, got %ld\",\\");
$self->pidl(" PyInt_Type.tp_name, PyLong_Type.tp_name, uint_max, test_var);");