public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
* [LTP] [PATCH 1/6] ltp: fix databinchk() definition
@ 2011-04-04 12:08 Alex Elder
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Elder @ 2011-04-04 12:08 UTC (permalink / raw)
  To: ltp-list

Fix a bogus (misspelled) declaration for databinchk() in
"include/databin.h".

Then, change databinchk() so that its second argument is a signed
rather than an unsigned character pointer.  This is consistent with
the way it is used throughout the code.  Because of the way that
argument is used, it won't change the behavior of that function; its
value is immediately assigned to a local variable, which is still
unsigned.  Add a cast in that assignment to force the conversion.

Signed-off-by: Alex Elder <aelder@sgi.com>
---
 include/databin.h |    2 +-
 lib/databin.c     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/databin.h b/include/databin.h
index c168799..93c3863 100644
--- a/include/databin.h
+++ b/include/databin.h
@@ -39,6 +39,6 @@
 
 void databingen( int mode, char *buffer, int bsize, int offset );
 
-void databinchedk( int mode, unsigned char *buffer, int bsize, int offset, char **errmsg);
+int databinchk( int mode, char *buffer, int bsize, int offset, char **errmsg);
 
 #endif
diff --git a/lib/databin.c b/lib/databin.c
index 6659ccf..c0f4307 100644
--- a/lib/databin.c
+++ b/lib/databin.c
@@ -91,7 +91,7 @@ int ind;
 int
 databinchk(mode, buffer, bsize, offset, errmsg)
 int mode;	/* either a, c, r, z, o, or C */
-unsigned char *buffer;	/* buffer pointer */
+char *buffer;	/* buffer pointer */
 int bsize;	/* size of buffer */
 int offset;	/* offset into the file where buffer starts */
 char **errmsg;
@@ -102,7 +102,7 @@ char **errmsg;
     long expbits;
     long actbits;
 
-	chr=buffer;
+	chr = (unsigned char *) buffer;
 	total=bsize;
 
 	if (errmsg != NULL) {
-- 
1.7.4




------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
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
* [LTP] [PATCH 0/6] ltp: kill off some compile warnings
@ 2011-04-01 22:01 Alex Elder
  2011-04-01 22:01 ` [LTP] [PATCH 1/6] ltp: fix databinchk() definition Alex Elder
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Elder @ 2011-04-01 22:01 UTC (permalink / raw)
  To: ltp-list

The motivation for this series of patches is to eliminate build
warnings in files under "testcases/kernel/fs/doio/".  The main
reason warnings are emitted is that most functions are defined using
old-style C syntax.  So most of the changes amount to updating such
functions to use standard C prototypes.

The first patch fixes a buggy header file.  The next one gathers
type definitions to the top of "doio.c" so they are defined when
needed in declaring all the function prototypes.

The last patch enables the "-Wall" flag to gcc for these files.

					-Alex

------------------------------------------------------------------------------
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

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

end of thread, other threads:[~2011-04-06 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-04 12:08 [LTP] [PATCH 1/6] ltp: fix databinchk() definition Alex Elder
  -- strict thread matches above, loose matches on Subject: below --
2011-04-01 22:01 [LTP] [PATCH 0/6] ltp: kill off some compile warnings Alex Elder
2011-04-01 22:01 ` [LTP] [PATCH 1/6] ltp: fix databinchk() definition Alex Elder
2011-04-06 13:05   ` Cyril Hrubis
     [not found]     ` <1302102133.2505.26.camel@doink>
2011-04-06 15:29       ` Cyril Hrubis

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