Don't use the deprecated 'register' storage specifier.

It is not only useless with any modern C++ compiler, but also deprecated
in C++11.  Removing it fixes Clang warnings on the subject.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2014-05-19 17:23:02 +00:00
parent 1b3cba17e8
commit 7a25cf4932
10 changed files with 68 additions and 70 deletions

View File

@@ -698,8 +698,8 @@ static wxPointList wx_spline_point_list;
void wx_quadratic_spline(double a1, double b1, double a2, double b2, double a3, double b3, double a4, void wx_quadratic_spline(double a1, double b1, double a2, double b2, double a3, double b3, double a4,
double b4) double b4)
{ {
register double xmid, ymid; double xmid, ymid;
double x1, y1, x2, y2, x3, y3, x4, y4; double x1, y1, x2, y2, x3, y3, x4, y4;
wx_clear_stack(); wx_clear_stack();
wx_spline_push(a1, b1, a2, b2, a3, b3, a4, b4); wx_spline_push(a1, b1, a2, b2, a3, b3, a4, b4);

View File

@@ -468,7 +468,7 @@ wxChar *wxCopyAbsolutePath(const wxString& filename)
template<typename CharType> template<typename CharType>
static CharType *wxDoExpandPath(CharType *buf, const wxString& name) static CharType *wxDoExpandPath(CharType *buf, const wxString& name)
{ {
register CharType *d, *s, *nm; CharType *d, *s, *nm;
CharType lnm[_MAXPATHLEN]; CharType lnm[_MAXPATHLEN];
int q; int q;
@@ -527,9 +527,9 @@ static CharType *wxDoExpandPath(CharType *buf, const wxString& name)
if (*s++ == wxT('$')) if (*s++ == wxT('$'))
#endif #endif
{ {
register CharType *start = d; CharType *start = d;
register int braces = (*s == wxT('{') || *s == wxT('(')); int braces = (*s == wxT('{') || *s == wxT('('));
register CharType *value; CharType *value;
while ((*d++ = *s) != 0) while ((*d++ = *s) != 0)
if (braces ? (*s == wxT('}') || *s == wxT(')')) : !(wxIsalnum(*s) || *s == wxT('_')) ) if (braces ? (*s == wxT('}') || *s == wxT(')')) : !(wxIsalnum(*s) || *s == wxT('_')) )
break; break;
@@ -568,7 +568,7 @@ static CharType *wxDoExpandPath(CharType *buf, const wxString& name)
} }
} else } else
{ /* ~user/filename */ { /* ~user/filename */
register CharType *nnm; CharType *nnm;
for (s = nm; *s && *s != SEP; s++) for (s = nm; *s && *s != SEP; s++)
{ {
// Empty // Empty

View File

@@ -206,9 +206,9 @@ void wx_jpeg_io_src( j_decompress_ptr cinfo, wxInputStream& infile )
static inline void wx_cmyk_to_rgb(unsigned char* rgb, const unsigned char* cmyk) static inline void wx_cmyk_to_rgb(unsigned char* rgb, const unsigned char* cmyk)
{ {
register int k = 255 - cmyk[3]; int k = 255 - cmyk[3];
register int k2 = cmyk[3]; int k2 = cmyk[3];
register int c; int c;
c = k + k2 * (255 - cmyk[0]) / 255; c = k + k2 * (255 - cmyk[0]) / 255;
rgb[0] = (unsigned char)((c > 255) ? 0 : (255 - c)); rgb[0] = (unsigned char)((c > 255) ? 0 : (255 - c));

View File

@@ -308,9 +308,9 @@ prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
JSAMPARRAY WXUNUSED(output_buf), int num_rows) JSAMPARRAY WXUNUSED(output_buf), int num_rows)
{ {
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
register JSAMPROW ptr; JSAMPROW ptr;
register histptr histp; histptr histp;
register hist3d histogram = cquantize->histogram; hist3d histogram = cquantize->histogram;
int row; int row;
JDIMENSION col; JDIMENSION col;
JDIMENSION width = cinfo->output_width; JDIMENSION width = cinfo->output_width;
@@ -361,9 +361,9 @@ find_biggest_color_pop (boxptr boxlist, int numboxes)
/* Find the splittable box with the largest color population */ /* Find the splittable box with the largest color population */
/* Returns NULL if no splittable boxes remain */ /* Returns NULL if no splittable boxes remain */
{ {
register boxptr boxp; boxptr boxp;
register int i; int i;
register long maxc = 0; long maxc = 0;
boxptr which = NULL; boxptr which = NULL;
for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
@@ -381,9 +381,9 @@ find_biggest_volume (boxptr boxlist, int numboxes)
/* Find the splittable box with the largest (scaled) volume */ /* Find the splittable box with the largest (scaled) volume */
/* Returns NULL if no splittable boxes remain */ /* Returns NULL if no splittable boxes remain */
{ {
register boxptr boxp; boxptr boxp;
register int i; int i;
register INT32 maxv = 0; INT32 maxv = 0;
boxptr which = NULL; boxptr which = NULL;
for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) { for (i = 0, boxp = boxlist; i < numboxes; i++, boxp++) {
@@ -514,7 +514,7 @@ median_cut (j_decompress_ptr cinfo, boxptr boxlist, int numboxes,
{ {
int n,lb; int n,lb;
int c0,c1,c2,cmax; int c0,c1,c2,cmax;
register boxptr b1,b2; boxptr b1,b2;
while (numboxes < desired_colors) { while (numboxes < desired_colors) {
/* Select box to split. /* Select box to split.
@@ -871,12 +871,12 @@ find_best_colors (j_decompress_ptr cinfo, int minc0, int minc1, int minc2,
{ {
int ic0, ic1, ic2; int ic0, ic1, ic2;
int i, icolor; int i, icolor;
register INT32 * bptr; /* pointer into bestdist[] array */ INT32 * bptr; /* pointer into bestdist[] array */
JSAMPLE * cptr; /* pointer into bestcolor[] array */ JSAMPLE * cptr; /* pointer into bestcolor[] array */
INT32 dist0, dist1; /* initial distance values */ INT32 dist0, dist1; /* initial distance values */
register INT32 dist2; /* current distance in inner loop */ INT32 dist2; /* current distance in inner loop */
INT32 xx0, xx1; /* distance increments */ INT32 xx0, xx1; /* distance increments */
register INT32 xx2; INT32 xx2;
INT32 inc0, inc1, inc2; /* initial values for increments */ INT32 inc0, inc1, inc2; /* initial values for increments */
/* This array holds the distance to the nearest-so-far color for each cell */ /* This array holds the distance to the nearest-so-far color for each cell */
INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS]; INT32 bestdist[BOX_C0_ELEMS * BOX_C1_ELEMS * BOX_C2_ELEMS];
@@ -949,8 +949,8 @@ fill_inverse_cmap (j_decompress_ptr cinfo, int c0, int c1, int c2)
hist3d histogram = cquantize->histogram; hist3d histogram = cquantize->histogram;
int minc0, minc1, minc2; /* lower left corner of update box */ int minc0, minc1, minc2; /* lower left corner of update box */
int ic0, ic1, ic2; int ic0, ic1, ic2;
register JSAMPLE * cptr; /* pointer into bestcolor[] array */ JSAMPLE * cptr; /* pointer into bestcolor[] array */
register histptr cachep; /* pointer into main cache array */ histptr cachep; /* pointer into main cache array */
/* This array lists the candidate colormap indexes. */ /* This array lists the candidate colormap indexes. */
JSAMPLE colorlist[MAXNUMCOLORS]; JSAMPLE colorlist[MAXNUMCOLORS];
int numcolors; /* number of candidate colors */ int numcolors; /* number of candidate colors */
@@ -1006,9 +1006,9 @@ pass2_no_dither (j_decompress_ptr cinfo,
{ {
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram; hist3d histogram = cquantize->histogram;
register JSAMPROW inptr, outptr; JSAMPROW inptr, outptr;
register histptr cachep; histptr cachep;
register int c0, c1, c2; int c0, c1, c2;
int row; int row;
JDIMENSION col; JDIMENSION col;
JDIMENSION width = cinfo->output_width; JDIMENSION width = cinfo->output_width;
@@ -1040,10 +1040,10 @@ pass2_fs_dither (j_decompress_ptr cinfo,
{ {
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize; my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram; hist3d histogram = cquantize->histogram;
register LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */ LOCFSERROR cur0, cur1, cur2; /* current error or pixel value */
LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */ LOCFSERROR belowerr0, belowerr1, belowerr2; /* error for pixel below cur */
LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */ LOCFSERROR bpreverr0, bpreverr1, bpreverr2; /* error for below/prev col */
register FSERRPTR errorptr; /* => fserrors[] at column before current */ FSERRPTR errorptr; /* => fserrors[] at column before current */
JSAMPROW inptr; /* => current input pixel */ JSAMPROW inptr; /* => current input pixel */
JSAMPROW outptr; /* => current output pixel */ JSAMPROW outptr; /* => current output pixel */
histptr cachep; histptr cachep;
@@ -1118,7 +1118,7 @@ pass2_fs_dither (j_decompress_ptr cinfo,
if (*cachep == 0) if (*cachep == 0)
fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT); fill_inverse_cmap(cinfo, cur0>>C0_SHIFT,cur1>>C1_SHIFT,cur2>>C2_SHIFT);
/* Now emit the colormap index for this cell */ /* Now emit the colormap index for this cell */
{ register int pixcode = *cachep - 1; { int pixcode = *cachep - 1;
*outptr = (JSAMPLE) pixcode; *outptr = (JSAMPLE) pixcode;
/* Compute representation error for this pixel */ /* Compute representation error for this pixel */
cur0 -= GETJSAMPLE(colormap0[pixcode]); cur0 -= GETJSAMPLE(colormap0[pixcode]);
@@ -1129,7 +1129,7 @@ pass2_fs_dither (j_decompress_ptr cinfo,
* Add these into the running sums, and simultaneously shift the * Add these into the running sums, and simultaneously shift the
* next-line error sums left by 1 column. * next-line error sums left by 1 column.
*/ */
{ register LOCFSERROR bnexterr, delta; { LOCFSERROR bnexterr, delta;
bnexterr = cur0; /* Process component 0 */ bnexterr = cur0; /* Process component 0 */
delta = cur0 * 2; delta = cur0 * 2;

View File

@@ -761,8 +761,8 @@ Thanks,
#define SWAP(a, b, size) \ #define SWAP(a, b, size) \
do \ do \
{ \ { \
register size_t __size = (size); \ size_t __size = (size); \
register char *__a = (a), *__b = (b); \ char *__a = (a), *__b = (b); \
do \ do \
{ \ { \
char __tmp = *__a; \ char __tmp = *__a; \
@@ -815,7 +815,7 @@ typedef struct
void wxQsort(void* pbase, size_t total_elems, void wxQsort(void* pbase, size_t total_elems,
size_t size, wxSortCallback cmp, const void* user_data) size_t size, wxSortCallback cmp, const void* user_data)
{ {
register char *base_ptr = (char *) pbase; char *base_ptr = (char *) pbase;
const size_t max_thresh = MAX_THRESH * size; const size_t max_thresh = MAX_THRESH * size;
if (total_elems == 0) if (total_elems == 0)
@@ -929,7 +929,7 @@ void wxQsort(void* pbase, size_t total_elems,
char *thresh = base_ptr + max_thresh; char *thresh = base_ptr + max_thresh;
if ( thresh > end_ptr ) if ( thresh > end_ptr )
thresh = end_ptr; thresh = end_ptr;
register char *run_ptr; char *run_ptr;
/* Find smallest element in first threshold and place it at the /* Find smallest element in first threshold and place it at the
array's beginning. This is the smallest array element, array's beginning. This is the smallest array element,

View File

@@ -768,7 +768,7 @@ wxChar32* wxStrdup(const wxChar32* s)
#ifndef wxCRT_StricmpA #ifndef wxCRT_StricmpA
WXDLLIMPEXP_BASE int wxCRT_StricmpA(const char *psz1, const char *psz2) WXDLLIMPEXP_BASE int wxCRT_StricmpA(const char *psz1, const char *psz2)
{ {
register char c1, c2; char c1, c2;
do { do {
c1 = wxTolower(*psz1++); c1 = wxTolower(*psz1++);
c2 = wxTolower(*psz2++); c2 = wxTolower(*psz2++);
@@ -780,7 +780,7 @@ WXDLLIMPEXP_BASE int wxCRT_StricmpA(const char *psz1, const char *psz2)
#ifndef wxCRT_StricmpW #ifndef wxCRT_StricmpW
WXDLLIMPEXP_BASE int wxCRT_StricmpW(const wchar_t *psz1, const wchar_t *psz2) WXDLLIMPEXP_BASE int wxCRT_StricmpW(const wchar_t *psz1, const wchar_t *psz2)
{ {
register wchar_t c1, c2; wchar_t c1, c2;
do { do {
c1 = wxTolower(*psz1++); c1 = wxTolower(*psz1++);
c2 = wxTolower(*psz2++); c2 = wxTolower(*psz2++);
@@ -793,7 +793,7 @@ WXDLLIMPEXP_BASE int wxCRT_StricmpW(const wchar_t *psz1, const wchar_t *psz2)
WXDLLIMPEXP_BASE int wxCRT_StrnicmpA(const char *s1, const char *s2, size_t n) WXDLLIMPEXP_BASE int wxCRT_StrnicmpA(const char *s1, const char *s2, size_t n)
{ {
// initialize the variables just to suppress stupid gcc warning // initialize the variables just to suppress stupid gcc warning
register char c1 = 0, c2 = 0; char c1 = 0, c2 = 0;
while (n && ((c1 = wxTolower(*s1)) == (c2 = wxTolower(*s2)) ) && c1) n--, s1++, s2++; while (n && ((c1 = wxTolower(*s1)) == (c2 = wxTolower(*s2)) ) && c1) n--, s1++, s2++;
if (n) { if (n) {
if (c1 < c2) return -1; if (c1 < c2) return -1;
@@ -807,7 +807,7 @@ WXDLLIMPEXP_BASE int wxCRT_StrnicmpA(const char *s1, const char *s2, size_t n)
WXDLLIMPEXP_BASE int wxCRT_StrnicmpW(const wchar_t *s1, const wchar_t *s2, size_t n) WXDLLIMPEXP_BASE int wxCRT_StrnicmpW(const wchar_t *s1, const wchar_t *s2, size_t n)
{ {
// initialize the variables just to suppress stupid gcc warning // initialize the variables just to suppress stupid gcc warning
register wchar_t c1 = 0, c2 = 0; wchar_t c1 = 0, c2 = 0;
while (n && ((c1 = wxTolower(*s1)) == (c2 = wxTolower(*s2)) ) && c1) n--, s1++, s2++; while (n && ((c1 = wxTolower(*s1)) == (c2 = wxTolower(*s2)) ) && c1) n--, s1++, s2++;
if (n) { if (n) {
if (c1 < c2) return -1; if (c1 < c2) return -1;

View File

@@ -655,9 +655,7 @@ bool REGION::XClipBox(Region r, wxRect *rect)
void REGION:: void REGION::
miSetExtents (Region pReg) miSetExtents (Region pReg)
{ {
register BoxPtr pBox, BoxPtr pBox, pBoxEnd, pExtents;
pBoxEnd,
pExtents;
if (pReg->numRects == 0) if (pReg->numRects == 0)
{ {
@@ -720,8 +718,8 @@ XOffsetRegion(
register int x, register int x,
register int y) register int y)
{ {
register int nbox; int nbox;
register BOX *pbox; BOX *pbox;
pbox = pRegion->rects; pbox = pRegion->rects;
nbox = pRegion->numRects; nbox = pRegion->numRects;
@@ -768,9 +766,9 @@ miIntersectO (
wxCoord y1, wxCoord y1,
wxCoord y2) wxCoord y2)
{ {
register wxCoord x1; wxCoord x1;
register wxCoord x2; wxCoord x2;
register BoxPtr pNextRect; BoxPtr pNextRect;
pNextRect = &pReg->rects[pReg->numRects]; pNextRect = &pReg->rects[pReg->numRects];
@@ -911,9 +909,9 @@ miCoalesce(
int prevStart, /* Index of start of previous band */ int prevStart, /* Index of start of previous band */
int curStart) /* Index of start of current band */ int curStart) /* Index of start of current band */
{ {
register BoxPtr pPrevBox; /* Current box in previous band */ BoxPtr pPrevBox; /* Current box in previous band */
register BoxPtr pCurBox; /* Current box in current band */ BoxPtr pCurBox; /* Current box in current band */
register BoxPtr pRegEnd; /* End of region */ BoxPtr pRegEnd; /* End of region */
int curNumRects; /* Number of rectangles in current int curNumRects; /* Number of rectangles in current
* band */ * band */
int prevNumRects; /* Number of rectangles in previous int prevNumRects; /* Number of rectangles in previous
@@ -1088,19 +1086,19 @@ miRegionOp(
* overlapping bands in region * overlapping bands in region
* 2 */ * 2 */
{ {
register BoxPtr r1; /* Pointer into first region */ BoxPtr r1; /* Pointer into first region */
register BoxPtr r2; /* Pointer into 2d region */ BoxPtr r2; /* Pointer into 2d region */
BoxPtr r1End; /* End of 1st region */ BoxPtr r1End; /* End of 1st region */
BoxPtr r2End; /* End of 2d region */ BoxPtr r2End; /* End of 2d region */
register wxCoord ybot; /* Bottom of intersection */ wxCoord ybot; /* Bottom of intersection */
register wxCoord ytop; /* Top of intersection */ wxCoord ytop; /* Top of intersection */
BoxPtr oldRects; /* Old rects for newReg */ BoxPtr oldRects; /* Old rects for newReg */
int prevBand; /* Index of start of int prevBand; /* Index of start of
* previous band in newReg */ * previous band in newReg */
int curBand; /* Index of start of current int curBand; /* Index of start of current
* band in newReg */ * band in newReg */
register BoxPtr r1BandEnd; /* End of current band in r1 */ BoxPtr r1BandEnd; /* End of current band in r1 */
register BoxPtr r2BandEnd; /* End of current band in r2 */ BoxPtr r2BandEnd; /* End of current band in r2 */
wxCoord top; /* Top of non-overlapping wxCoord top; /* Top of non-overlapping
* band */ * band */
wxCoord bot; /* Bottom of non-overlapping wxCoord bot; /* Bottom of non-overlapping
@@ -1374,7 +1372,7 @@ miUnionNonO (
register wxCoord y1, register wxCoord y1,
register wxCoord y2) register wxCoord y2)
{ {
register BoxPtr pNextRect; BoxPtr pNextRect;
pNextRect = &pReg->rects[pReg->numRects]; pNextRect = &pReg->rects[pReg->numRects];
@@ -1425,7 +1423,7 @@ miUnionO (
register wxCoord y1, register wxCoord y1,
register wxCoord y2) register wxCoord y2)
{ {
register BoxPtr pNextRect; BoxPtr pNextRect;
pNextRect = &pReg->rects[pReg->numRects]; pNextRect = &pReg->rects[pReg->numRects];
@@ -1575,7 +1573,7 @@ miSubtractNonO1 (
register wxCoord y1, register wxCoord y1,
register wxCoord y2) register wxCoord y2)
{ {
register BoxPtr pNextRect; BoxPtr pNextRect;
pNextRect = &pReg->rects[pReg->numRects]; pNextRect = &pReg->rects[pReg->numRects];
@@ -1624,8 +1622,8 @@ miSubtractO (
register wxCoord y1, register wxCoord y1,
register wxCoord y2) register wxCoord y2)
{ {
register BoxPtr pNextRect; BoxPtr pNextRect;
register int x1; int x1;
x1 = r1->x1; x1 = r1->x1;
@@ -1858,10 +1856,10 @@ wxRegionContain REGION::XRectInRegion(register Region region,
unsigned int rwidth, unsigned int rwidth,
unsigned int rheight) unsigned int rheight)
{ {
register BoxPtr pbox; BoxPtr pbox;
register BoxPtr pboxEnd; BoxPtr pboxEnd;
Box rect; Box rect;
register BoxPtr prect = &rect; BoxPtr prect = &rect;
int partIn, partOut; int partIn, partOut;
prect->x1 = rx; prect->x1 = rx;

View File

@@ -238,9 +238,9 @@ g_cclosure_user_marshal_VOID__OBJECT_OBJECT (GClosure *closure,
gpointer arg_1, gpointer arg_1,
gpointer arg_2, gpointer arg_2,
gpointer data2); gpointer data2);
register GMarshalFunc_VOID__OBJECT_OBJECT callback; GMarshalFunc_VOID__OBJECT_OBJECT callback;
register GCClosure *cc = (GCClosure*) closure; GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2; gpointer data1, data2;
g_return_if_fail (n_param_values == 3); g_return_if_fail (n_param_values == 3);

View File

@@ -1321,7 +1321,7 @@ wxBitmap::wxBitmap(const wxImage& image, int depth, double scale)
UseAlpha() ; UseAlpha() ;
unsigned char* destinationstart = (unsigned char*) BeginRawAccess() ; unsigned char* destinationstart = (unsigned char*) BeginRawAccess() ;
register unsigned char* data = image.GetData(); unsigned char* data = image.GetData();
if ( destinationstart != NULL && data != NULL ) if ( destinationstart != NULL && data != NULL )
{ {
const unsigned char *alpha = hasAlpha ? image.GetAlpha() : NULL ; const unsigned char *alpha = hasAlpha ? image.GetAlpha() : NULL ;

View File

@@ -634,7 +634,7 @@ wxChar* wxRichTextHTMLHandler::b64enc( unsigned char* input, size_t in_len )
while( in_len-- > 0 ) while( in_len-- > 0 )
{ {
register wxChar a, b; wxChar a, b;
a = *input++; a = *input++;