Skip to contentSkip to conversation

nfs/nfsstress/make_tree: Replace integer cast to pointer with 0

PATCH NAK Markos Chandras 4 participants 4 messages Jan 3, 2012 – Jan 4, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 20/21 nfs/nfsstress/make_tree: Replace integer cast to pointer with 0

Hi, please review the attached patch

Signature · 1 line
markos

From ff5db5fee1bff9a29aca9cdeaf5fbe00b806d4ea Mon Sep 17 00:00:00 2001
From: Markos Chandras <[email protected]>
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.

---
 testcases/network/nfs/nfsstress/make_tree.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
testcases/network/nfs/nfsstress/make_tree.c +3 -3
index c51e75e..c0b4d22 100644
@@ -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)
Signature · 1 line
1.7.1

------------------------------------------------------------------------------
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

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reviewed-by on v1 20/21
#1 lore raw
Quoted 1 line · Markos Chandras

Hi, please review the attached patch

It would be better if it was strtoll, but this works for now.
Thanks!
-Garrett

------------------------------------------------------------------------------
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
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
In reply to Markos Chandras
Quoted 1 line · On Tuesday 03 January 2012 08:25:09 Markos Chandras wrote:

Hi, please review the attached patch

looks good
-mike

------------------------------------------------------------------------------
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

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
In reply to Markos Chandras

Hi!

Quoted 4 lines

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.

Commited, thanks.

Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list