open-src/lib/libXext/sun-src/src/TransOvl.c
changeset 1345 d5dacbb8de2b
parent 943 294f64612d23
equal deleted inserted replaced
1344:800e8c2d47f1 1345:d5dacbb8de2b
     1 /* Copyright (c) 1996, 2008, Oracle and/or its affiliates. All rights reserved.
     1 /* Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved.
     2  *
     2  *
     3  * Permission is hereby granted, free of charge, to any person obtaining a
     3  * Permission is hereby granted, free of charge, to any person obtaining a
     4  * copy of this software and associated documentation files (the "Software"),
     4  * copy of this software and associated documentation files (the "Software"),
     5  * to deal in the Software without restriction, including without limitation
     5  * to deal in the Software without restriction, including without limitation
     6  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
     6  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
    31 #include <X11/Xlibint.h>
    31 #include <X11/Xlibint.h>
    32 #include <X11/Xutil.h>
    32 #include <X11/Xutil.h>
    33 #include <X11/extensions/extutil.h>
    33 #include <X11/extensions/extutil.h>
    34 #include <X11/extensions/transovlstr.h>
    34 #include <X11/extensions/transovlstr.h>
    35 #include <X11/extensions/multibuf.h>
    35 #include <X11/extensions/multibuf.h>
       
    36 #include <limits.h>
    36 
    37 
    37 typedef struct {
    38 typedef struct {
    38     XExtData		extdata;
    39     XExtData		extdata;
    39     int			numVisPairs;
    40     int			numVisPairs;
    40     Bool		pairsRestricted;
    41     Bool		pairsRestricted;
  1169     {
  1170     {
  1170 	UnlockDisplay(dpy);
  1171 	UnlockDisplay(dpy);
  1171 	SyncHandle();
  1172 	SyncHandle();
  1172 	return NULL;
  1173 	return NULL;
  1173     }
  1174     }
  1174     nbytes = (long)rep.length << 2;
  1175     if (rep.length < (INT_MAX >> 2)) {
  1175     data = (char *)Xmalloc((size_t)nbytes);
  1176 	nbytes = (long)rep.length << 2;
       
  1177 	data = Xmalloc((size_t)nbytes);
       
  1178     } else {
       
  1179 	data = NULL;
       
  1180     }
  1176     if (!data) {
  1181     if (!data) {
  1177 	_XEatData(dpy, (unsigned long)nbytes);
  1182 	_XEatDataWords(dpy, rep.length);
  1178 	UnlockDisplay(dpy);
  1183 	UnlockDisplay(dpy);
  1179 	SyncHandle();
  1184 	SyncHandle();
  1180 	return NULL;
  1185 	return NULL;
  1181     }
  1186     }
  1182     _XReadPad (dpy, data, nbytes);
  1187     _XReadPad (dpy, data, nbytes);