提交 3b67fc9f 编写于 作者: M Michal Privoznik

examples: Resolve sign-compare warnings

For instance:

hellolibvirt/hellolibvirt.c: In function 'showDomains':
hellolibvirt/hellolibvirt.c:100:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (i = 0; i < numNames; i++) {
                   ^
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 86fd4e30
......@@ -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) {
......
......@@ -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 "
......
......@@ -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) {
......
......@@ -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 */
......
......@@ -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 "
......
......@@ -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");
......
......@@ -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");
......
......@@ -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;
......
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册