examples: Resolve sign-compare warnings

For instance:

hellolibvirt/hellolibvirt.c: In function 'showDomains':
hellolibvirt/hellolibvirt.c💯19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i = 0; i < numNames; i++) {
                   ^

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-12-20 10:29:52 +01:00
parent 86fd4e305e
commit 3b67fc9f9f
9 changed files with 9 additions and 9 deletions

View File

@ -102,7 +102,7 @@ int main(int argc, char **argv)
virAdmClientPtr clnt = NULL; /* which client get identity for */
virTypedParameterPtr params = NULL; /* where to store identity info */
int nparams = 0;
size_t i = 0;
ssize_t i = 0;
char *timestr = NULL;
if (argc != 3) {

View File

@ -9,7 +9,7 @@ int main(int argc, char **argv)
virAdmServerPtr srv = NULL; /* which server to work with */
virTypedParameterPtr params = NULL;
int nparams = 0;
size_t i;
ssize_t i;
if (argc != 2) {
fprintf(stderr, "One argument specifying the server which to work "

View File

@ -50,7 +50,7 @@ int main(int argc, char **argv)
virAdmConnectPtr conn = NULL;
virAdmServerPtr srv = NULL; /* which server list the clients from */
virAdmClientPtr *clients = NULL; /* where to store the servers */
size_t i = 0;
ssize_t i = 0;
int count = 0;
if (argc != 2) {

View File

@ -8,7 +8,7 @@ int main(void)
virAdmConnectPtr conn = NULL;
virAdmServerPtr *servers = NULL; /* where to store the servers */
virAdmServerPtr *tmp = NULL;
size_t i = 0;
ssize_t i = 0;
int count = 0;
/* first, open a connection to the daemon */

View File

@ -9,7 +9,7 @@ int main(int argc, char **argv)
virAdmServerPtr srv = NULL; /* which server to work with */
virTypedParameterPtr params = NULL;
int nparams = 0;
size_t i;
ssize_t i;
if (argc != 2) {
fprintf(stderr, "One argument specifying the server which to work "

View File

@ -156,7 +156,7 @@ fetch_domains(virConnectPtr conn)
{
int num_domains, ret = -1;
virDomainPtr *domains = NULL;
size_t i;
ssize_t i;
const int list_flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE;
DEBUG("Fetching list of running domains");

View File

@ -161,7 +161,7 @@ fetch_domains(virConnectPtr conn)
{
int num_domains, ret = -1;
virDomainPtr *domains = NULL;
size_t i;
ssize_t i;
const int list_flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE;
DEBUG("Fetching list of running domains");

View File

@ -55,7 +55,7 @@ static int
showDomains(virConnectPtr conn)
{
int ret = 0, numNames, numInactiveDomains, numActiveDomains;
size_t i;
ssize_t i;
int flags = VIR_CONNECT_LIST_DOMAINS_ACTIVE |
VIR_CONNECT_LIST_DOMAINS_INACTIVE;
virDomainPtr *nameList = NULL;

View File

@ -91,7 +91,7 @@ static int
showDomains(virConnectPtr conn)
{
int ret = 0, numNames, numInactiveDomains, numActiveDomains;
size_t i;
ssize_t i;
char **nameList = NULL;
numActiveDomains = virConnectNumOfDomains(conn);