Ver Fonte

testcpg2.c: avoid 1 warning

* test/testcpg2.c (main): Add a const-discarding cast.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1953 fd59a12c-fef9-0310-b244-a6a79926bd2f
Jim Meyering há 17 anos atrás
pai
commit
df81971a5a
1 ficheiros alterados com 3 adições e 3 exclusões
  1. 3 3
      test/testcpg2.c

+ 3 - 3
test/testcpg2.c

@@ -1,5 +1,5 @@
 /*
 /*
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2007, 2009 Red Hat, Inc.
  *
  *
  * All rights reserved.
  * All rights reserved.
  *
  *
@@ -78,12 +78,12 @@ int main(int argc, char** argv) {
 	assert(CS_OK==cpg_local_get(handle,&nodeid));
 	assert(CS_OK==cpg_local_get(handle,&nodeid));
 	printf("local_get: %x\n", nodeid);
 	printf("local_get: %x\n", nodeid);
 	assert(CS_OK==cpg_join(handle, &group));
 	assert(CS_OK==cpg_join(handle, &group));
-	struct iovec msg={"hello", 5};
+	struct iovec msg={(void *)"hello", 5}; /* discard const */
 	assert(CS_OK==cpg_mcast_joined(handle,CPG_TYPE_AGREED,&msg,1));
 	assert(CS_OK==cpg_mcast_joined(handle,CPG_TYPE_AGREED,&msg,1));
 	cpg_fd_get (handle, &fd);
 	cpg_fd_get (handle, &fd);
 	pfd.fd = fd;
 	pfd.fd = fd;
 	pfd.events = POLLIN;
 	pfd.events = POLLIN;
-		
+
 	poll (&pfd, 1, 1000);
 	poll (&pfd, 1, 1000);
 	cpg_dispatch(handle, CS_DISPATCH_ALL);
 	cpg_dispatch(handle, CS_DISPATCH_ALL);
 	return (0);
 	return (0);