aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/src/PutImage.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/src/PutImage.c')
-rw-r--r--nx-X11/lib/src/PutImage.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/nx-X11/lib/src/PutImage.c b/nx-X11/lib/src/PutImage.c
index daf172cf0..b3a1a96df 100644
--- a/nx-X11/lib/src/PutImage.c
+++ b/nx-X11/lib/src/PutImage.c
@@ -32,6 +32,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h>
#include "Cr.h"
#include "ImUtil.h"
+#include "reallocarray.h"
#if defined(__STDC__) && ((defined(sun) && defined(SVR4)) || defined(WIN32))
#define RConst /**/
@@ -114,8 +115,8 @@ static unsigned char const _reverse_nibs[0x100] = {
int
_XReverse_Bytes(
- register unsigned char *bpt,
- register int nb)
+ unsigned char *bpt,
+ int nb)
{
do {
*bpt = _reverse_byte[*bpt];
@@ -598,7 +599,7 @@ static int const HalfOrderWord[12] = {
#define UnGetReq(name)\
dpy->bufptr -= SIZEOF(x##name##Req);\
- dpy->request--
+ X_DPY_REQUEST_DECREMENT(dpy)
static void
SendXYImage(
@@ -767,7 +768,7 @@ SendZImage(
(req_yoffset * image->bytes_per_line) +
((req_xoffset * image->bits_per_pixel) >> 3);
if ((image->bits_per_pixel == 4) && ((unsigned int) req_xoffset & 0x01)) {
- if (! (shifted_src = Xmalloc(req->height * image->bytes_per_line))) {
+ if (! (shifted_src = Xmallocarray(req->height, image->bytes_per_line))) {
UnGetReq(PutImage);
return;
}
@@ -987,7 +988,7 @@ XPutImage (
img.bits_per_pixel = dest_bits_per_pixel;
img.bytes_per_line = ROUNDUP((dest_bits_per_pixel * width),
dest_scanline_pad) >> 3;
- img.data = Xmalloc(img.bytes_per_line * height);
+ img.data = Xmallocarray(height, img.bytes_per_line);
if (img.data == NULL)
return 0;
_XInitImageFuncPtrs(&img);