fix a obscure compiler warning
authorGuenther Deschner <gd@samba.org>
Tue, 27 Nov 2007 20:53:41 +0000 (21:53 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 27 Nov 2007 21:03:19 +0000 (13:03 -0800)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Jeremy,

I have never seen this warning before:
"warning: comparison is always false due to limited range of data type".

Guenther
- --
Günther Deschner                    GPG-ID: 8EE11688
Red Hat                         gdeschner@redhat.com
Samba Team                              gd@samba.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHTIOOSOk3aI7hFogRArxMAJwP0ktE96tHcwn9nXG6AOqonpeDgQCgm/zi
54B6HJZvx6zdUTMFFNWqUb0=
=kUJa
-----END PGP SIGNATURE-----

>From 6a4935ee455adc1251fce2759f97d35f303bd40e Mon Sep 17 00:00:00 2001
From: =?utf-8?q?G=C3=BCnther=20Deschner?= <gd@samba.org>
Date: Tue, 27 Nov 2007 21:48:39 +0100
Subject: [PATCH] Getting rid of "comparison is always false due to limited range of data type"
 warning.

Guenther
(This used to be commit 951202913956e113841585f7372e8db8f9aeb76a)

source3/rpc_server/srv_eventlog_lib.c

index b9648283e1ac03e6bb13a5a5f11865a77f501a8e..4e996ee19bf48f688e48a91f7e97f84395990abc 100644 (file)
@@ -667,7 +667,7 @@ bool parse_logentry( char *line, Eventlog_entry * entry, bool * eor )
                entry->data_record.source_name_len = rpcstr_push_talloc(ctx,
                                &entry->data_record.source_name,
                                stop);
-               if (entry->data_record.source_name_len == (size_t)-1 ||
+               if (entry->data_record.source_name_len == (uint32_t)-1 ||
                                entry->data_record.source_name == NULL) {
                        return false;
                }
@@ -679,7 +679,7 @@ bool parse_logentry( char *line, Eventlog_entry * entry, bool * eor )
                entry->data_record.computer_name_len = rpcstr_push_talloc(ctx,
                                &entry->data_record.computer_name,
                                stop);
-               if (entry->data_record.computer_name_len == (size_t)-1 ||
+               if (entry->data_record.computer_name_len == (uint32_t)-1 ||
                                entry->data_record.computer_name == NULL) {
                        return false;
                }
@@ -691,7 +691,7 @@ bool parse_logentry( char *line, Eventlog_entry * entry, bool * eor )
                entry->record.user_sid_length = rpcstr_push_talloc(ctx,
                                &entry->data_record.sid,
                                stop);
-               if (entry->record.user_sid_length == (size_t)-1 ||
+               if (entry->record.user_sid_length == (uint32_t)-1 ||
                                entry->data_record.sid == NULL) {
                        return false;
                }