public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 20/21] nfs/nfsstress/make_tree: Replace integer cast to pointer with 0
@ 2012-01-03 13:25 Markos Chandras
  2012-01-03 19:31 ` Garrett Cooper
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Markos Chandras @ 2012-01-03 13:25 UTC (permalink / raw)
  To: ltp-list

[-- Attachment #1: Type: text/plain, Size: 49 bytes --]

Hi, please review the attached patch

-- 
markos

[-- Attachment #2: 0020-nfs-nfsstress-make_tree-Replace-integer-cast-to-poin.patch --]
[-- Type: text/plain, Size: 1980 bytes --]

From ff5db5fee1bff9a29aca9cdeaf5fbe00b806d4ea Mon Sep 17 00:00:00 2001
From: Markos Chandras <markos.chandras@imgtec.com>
Date: Thu, 22 Dec 2011 15:18:25 +0000
Subject: [PATCH 20/21] nfs/nfsstress/make_tree: Replace integer cast to pointer with 0

Because pointers are 64-bit on x86_64 architectures, casting a pointer to
integer makes the compiler complain about casting pointer to integer of
different size. We can easily fix this warning by simple replace (int)NULL with
0.

Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>
---
 testcases/network/nfs/nfsstress/make_tree.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/testcases/network/nfs/nfsstress/make_tree.c b/testcases/network/nfs/nfsstress/make_tree.c
index c51e75e..c0b4d22 100644
--- a/testcases/network/nfs/nfsstress/make_tree.c
+++ b/testcases/network/nfs/nfsstress/make_tree.c
@@ -771,7 +771,7 @@ main(int	argc,		/* number of input parameters		      */
         switch(c)
         {
             case 'd':		/* specify how deep the tree needs to grow    */
-	        if ((num_dirs = atoi(optarg)) == (int)NULL)
+	        if ((num_dirs = atoi(optarg)) == 0)
 		    OPT_MISSING(argv[0], optopt);
                 else
                 if (num_dirs < 0)
@@ -782,7 +782,7 @@ main(int	argc,		/* number of input parameters		      */
                 }
 		break;
             case 'f':		/* how many ".c" files in each directory.     */
-		if ((num_files = atoi(optarg)) == (int)NULL)
+		if ((num_files = atoi(optarg)) == 0)
                     OPT_MISSING(argv[0], optopt);
                 else
 	        if (num_files < 0)
@@ -796,7 +796,7 @@ main(int	argc,		/* number of input parameters		      */
                 usage(argv[0]);
                 break;
             case 't':
-		if ((num_thrd = atoi(optarg)) == (int)NULL)
+		if ((num_thrd = atoi(optarg)) == 0)
 	            OPT_MISSING(argv[0], optopt);
                 else
                 if (num_thrd < 0)
-- 
1.7.1


[-- Attachment #3: Type: text/plain, Size: 355 bytes --]

------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev

[-- Attachment #4: Type: text/plain, Size: 155 bytes --]

_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-01-04 15:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-03 13:25 [LTP] [PATCH 20/21] nfs/nfsstress/make_tree: Replace integer cast to pointer with 0 Markos Chandras
2012-01-03 19:31 ` Garrett Cooper
2012-01-03 20:32 ` Mike Frysinger
2012-01-04 16:03 ` Cyril Hrubis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox