public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Alex Elder <aelder@sgi.com>
To: ltp-list <ltp-list@lists.sourceforge.net>
Subject: [LTP] [PATCH 1/6] ltp: fix databinchk() definition
Date: Mon, 04 Apr 2011 07:08:22 -0500	[thread overview]
Message-ID: <1301918902.3282.24.camel@doink> (raw)

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

             reply	other threads:[~2011-04-04 12:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-04 12:08 Alex Elder [this message]
  -- 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1301918902.3282.24.camel@doink \
    --to=aelder@sgi.com \
    --cc=ltp-list@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox