diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:04:13 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-03-28 19:09:21 +0100 |
commit | 33815ec44937f731ce3de9146a97265662d0d206 (patch) | |
tree | 40257290d306f43f9e5bb521c9ac9344a11cfd88 /hwpfilter | |
parent | 5d950b3afd91e87035d24b550f29d0b3a7c5033b (diff) |
Clean up C-style casts from pointers to void
Change-Id: Ifbdbd2bb8a21afa76271728c46f88c11a887fc5a
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/formula.cxx | 4 | ||||
-rw-r--r-- | hwpfilter/source/grammar.cxx | 4 | ||||
-rw-r--r-- | hwpfilter/source/hbox.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hcode.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hgzip.cxx | 8 | ||||
-rw-r--r-- | hwpfilter/source/hiodev.cxx | 8 | ||||
-rw-r--r-- | hwpfilter/source/hstream.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hstyle.cxx | 2 | ||||
-rw-r--r-- | hwpfilter/source/hwpreader.cxx | 14 | ||||
-rw-r--r-- | hwpfilter/source/lexer.cxx | 14 | ||||
-rw-r--r-- | hwpfilter/source/mzstring.cxx | 4 |
11 files changed, 32 insertions, 32 deletions
diff --git a/hwpfilter/source/formula.cxx b/hwpfilter/source/formula.cxx index 0729396a8fb1..bb48aef6a6ff 100644 --- a/hwpfilter/source/formula.cxx +++ b/hwpfilter/source/formula.cxx @@ -585,7 +585,7 @@ int Formula::parse() break; } - char *buf = (char *)malloc(a.length()+1); + char *buf = static_cast<char *>(malloc(a.length()+1)); bool bStart = false; int i, j; for( i = 0, j=0 ; i < a.length() ; i++){ // rtrim and ltrim 32 10 13 @@ -634,7 +634,7 @@ int Formula::parse() void Formula::trim() { int len = strlen(eq); - char *buf = (char *)malloc(len+1); + char *buf = static_cast<char *>(malloc(len+1)); bool bStart = false; int i, j; for( i = 0, j=0 ; i < len ; i++){ // rtrim and ltrim 32 10 13 diff --git a/hwpfilter/source/grammar.cxx b/hwpfilter/source/grammar.cxx index bfde898d667c..979d15e14550 100644 --- a/hwpfilter/source/grammar.cxx +++ b/hwpfilter/source/grammar.cxx @@ -615,10 +615,10 @@ yynewstate: #ifndef YYSTACK_USE_ALLOCA yyfree_stacks = 1; #endif - yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + yyss = static_cast<short *>(YYSTACK_ALLOC (yystacksize * sizeof (*yyssp))); memcpy (yyss, yyss1, size * (unsigned int) sizeof (*yyssp)); - yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + yyvs = static_cast<YYSTYPE *>(YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp))); memcpy (yyvs, yyvs1, size * (unsigned int) sizeof (*yyvsp)); #ifdef YYLSP_NEEDED diff --git a/hwpfilter/source/hbox.cxx b/hwpfilter/source/hbox.cxx index 4fd3b4d2b9da..7fe3c64f9fb6 100644 --- a/hwpfilter/source/hbox.cxx +++ b/hwpfilter/source/hbox.cxx @@ -405,7 +405,7 @@ Picture::~Picture(void) { delete[]follow; if( pictype == PICTYPE_DRAW && picinfo.picdraw.hdo ) - delete (HWPDrawingObject *) picinfo.picdraw.hdo; + delete static_cast<HWPDrawingObject *>(picinfo.picdraw.hdo); std::list < HWPPara* >::iterator it = caption.begin(); for (; it != caption.end(); ++it) diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index b674d5cbcd92..e0150524b27b 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -1399,7 +1399,7 @@ char* base64_encode_string( const uchar *buf, unsigned int len ) int c1, c2; unsigned int i; - out=(char *)malloc( (len*4/3)+8 ); + out=static_cast<char *>(malloc( (len*4/3)+8 )); /* Get three characters at a time and encode them. */ for (i=0; i < len/3; ++i) diff --git a/hwpfilter/source/hgzip.cxx b/hwpfilter/source/hgzip.cxx index 6b7e0b973e8e..fa11f6f45dbd 100644 --- a/hwpfilter/source/hgzip.cxx +++ b/hwpfilter/source/hgzip.cxx @@ -58,7 +58,7 @@ gz_stream *gz_open(HStream & _stream) //char *m = fmode; gz_stream *s; - s = (gz_stream *) ALLOC(sizeof(gz_stream)); + s = static_cast<gz_stream *>(ALLOC(sizeof(gz_stream))); if (!s) return Z_NULL; s->stream.zalloc = (alloc_func) 0; @@ -78,7 +78,7 @@ gz_stream *gz_open(HStream & _stream) //realking err = inflateInit2(&(s->stream), -MAX_WBITS); - s->stream.next_in = s->inbuf = (Byte *) ALLOC(Z_BUFSIZE); + s->stream.next_in = s->inbuf = static_cast<Byte *>(ALLOC(Z_BUFSIZE)); if (err != Z_OK || s->inbuf == Z_NULL) { @@ -157,7 +157,7 @@ int gz_read(gz_stream * file, voidp buf, unsigned len) { //printf("@@ gz_read : len : %d\t",len); gz_stream *s = (gz_stream *) file; - Bytef *start = (Bytef *) buf; /* starting point for crc computation */ + Bytef *start = static_cast<Bytef *>(buf); /* starting point for crc computation */ Byte *next_out; /* == stream.next_out but not forced far (for MSDOS) */ if (s == NULL) return Z_STREAM_ERROR; @@ -167,7 +167,7 @@ int gz_read(gz_stream * file, voidp buf, unsigned len) if (s->z_err == Z_STREAM_END) return 0; /* EOF */ - s->stream.next_out = next_out = (Bytef *) buf; + s->stream.next_out = next_out = static_cast<Bytef *>(buf); s->stream.avail_out = len; while (s->stream.avail_out != 0) diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx index 18471a26ea26..b5c564cc38a9 100644 --- a/hwpfilter/source/hiodev.cxx +++ b/hwpfilter/source/hiodev.cxx @@ -57,7 +57,7 @@ void HIODev::init() int HIODev::read1b(void *ptr, int nmemb) { - uchar *p = (uchar *) ptr; + uchar *p = static_cast<uchar *>(ptr); int ii; if (state()) @@ -74,7 +74,7 @@ int HIODev::read1b(void *ptr, int nmemb) int HIODev::read2b(void *ptr, int nmemb) { - ushort *p = (ushort *) ptr; + ushort *p = static_cast<ushort *>(ptr); int ii; if (state()) @@ -91,7 +91,7 @@ int HIODev::read2b(void *ptr, int nmemb) int HIODev::read4b(void *ptr, int nmemb) { - uint *p = (uint *) ptr; + uint *p = static_cast<uint *>(ptr); int ii; if (state()) @@ -233,7 +233,7 @@ bool HStreamIODev::read4b(int &out) int HStreamIODev::readBlock(void *ptr, int size) { int count = - (compressed) ? GZREAD(ptr, size) : _stream->readBytes((byte *) ptr, + (compressed) ? GZREAD(ptr, size) : _stream->readBytes(static_cast<byte *>(ptr), size); diff --git a/hwpfilter/source/hstream.cxx b/hwpfilter/source/hstream.cxx index e3c1b4244ee1..e002d346ac79 100644 --- a/hwpfilter/source/hstream.cxx +++ b/hwpfilter/source/hstream.cxx @@ -36,7 +36,7 @@ HStream::~HStream() void HStream::addData( const byte *buf, int aToAdd) { - seq = (byte *)realloc( seq, size + aToAdd ); + seq = static_cast<byte *>(realloc( seq, size + aToAdd )); memcpy( seq + size, buf, aToAdd ); size += aToAdd; } diff --git a/hwpfilter/source/hstyle.cxx b/hwpfilter/source/hstyle.cxx index 6be9bd85f343..0d2c8674cefa 100644 --- a/hwpfilter/source/hstyle.cxx +++ b/hwpfilter/source/hstyle.cxx @@ -28,7 +28,7 @@ enum { MAXSTYLENAME = 20 }; -#define DATA ((StyleData *)style) +#define DATA static_cast<StyleData *>(style) struct StyleData { diff --git a/hwpfilter/source/hwpreader.cxx b/hwpfilter/source/hwpreader.cxx index 93f99686c3d3..7a7a3d01f902 100644 --- a/hwpfilter/source/hwpreader.cxx +++ b/hwpfilter/source/hwpreader.cxx @@ -692,7 +692,7 @@ void HwpReader::makeStyles() { if( hwpfile.getFBoxStyle(i)->boxtype == 'D' ) { - makeDrawMiscStyle((HWPDrawingObject *)hwpfile.getFBoxStyle(i)->cell ); + makeDrawMiscStyle(static_cast<HWPDrawingObject *>(hwpfile.getFBoxStyle(i)->cell) ); } } @@ -823,7 +823,7 @@ void HwpReader::makeAutoStyles() for (i = 0; i < hwpfile.getFBoxStyleCount(); i++) { if( hwpfile.getFBoxStyle(i)->boxtype == 'D' ) - makeDrawStyle((HWPDrawingObject *)hwpfile.getFBoxStyle(i)->cell, hwpfile.getFBoxStyle(i)); + makeDrawStyle(static_cast<HWPDrawingObject *>(hwpfile.getFBoxStyle(i)->cell), hwpfile.getFBoxStyle(i)); else makeFStyle(hwpfile.getFBoxStyle(i)); } @@ -2299,7 +2299,7 @@ void HwpReader::makeCaptionStyle(FBoxStyle * fstyle) padd("style:horizontal-rel", sXML_CDATA, "paragraph"); if( fstyle->boxtype == 'G' ) { - char *cell = (char *)fstyle->cell; + char *cell = static_cast<char *>(fstyle->cell); padd("draw:luminance", sXML_CDATA, ascii(Int2Str(cell[0], "%d%%", buf))); padd("draw:contrast", sXML_CDATA, @@ -2313,7 +2313,7 @@ void HwpReader::makeCaptionStyle(FBoxStyle * fstyle) } else { - Cell *cell = (Cell *)fstyle->cell; + Cell *cell = static_cast<Cell *>(fstyle->cell); if(cell->linetype[0] == cell->linetype[1] && cell->linetype[0] == cell->linetype[2] && cell->linetype[0] == cell->linetype[3]) @@ -2524,7 +2524,7 @@ void HwpReader::makeFStyle(FBoxStyle * fstyle) } if( fstyle->boxtype == 'X' || fstyle->boxtype == 'B' ) { - Cell *cell = (Cell *)fstyle->cell; + Cell *cell = static_cast<Cell *>(fstyle->cell); if(cell->linetype[0] == cell->linetype[1] && cell->linetype[0] == cell->linetype[2] && cell->linetype[0] == cell->linetype[3]) @@ -2648,7 +2648,7 @@ void HwpReader::makeFStyle(FBoxStyle * fstyle) padd("style:mirror", sXML_CDATA, "none"); padd("fo:clip", sXML_CDATA, clip); } - char *cell = (char *)fstyle->cell; + char *cell = static_cast<char *>(fstyle->cell); padd("draw:luminance", sXML_CDATA, ascii(Int2Str(cell[0], "%d%%", buf))); padd("draw:contrast", sXML_CDATA, @@ -3947,7 +3947,7 @@ void HwpReader::makePicture(Picture * hbox) if( hbox->picinfo.picdraw.zorder > 0 ) padd("draw:z-index", sXML_CDATA, ascii(Int2Str( hbox->picinfo.picdraw.zorder + 10000, "%d", buf))); - makePictureDRAW( (HWPDrawingObject *) hbox->picinfo.picdraw.hdo, hbox); + makePictureDRAW( static_cast<HWPDrawingObject *>(hbox->picinfo.picdraw.hdo), hbox); break; case PICTYPE_UNKNOWN: break; diff --git a/hwpfilter/source/lexer.cxx b/hwpfilter/source/lexer.cxx index efea4760fab5..1424d3bd8b04 100644 --- a/hwpfilter/source/lexer.cxx +++ b/hwpfilter/source/lexer.cxx @@ -1588,10 +1588,10 @@ static int yy_get_next_buffer() else b->yy_buf_size *= 2; - b->yy_ch_buf = (char *) + b->yy_ch_buf = static_cast<char *>( /* Include room in for 2 EOB chars. */ yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); + b->yy_buf_size + 2 )); } else /* Can't grow it, we don't own it. */ @@ -1779,7 +1779,7 @@ int size; { YY_BUFFER_STATE b; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + b = static_cast<YY_BUFFER_STATE>(yy_flex_alloc( sizeof( struct yy_buffer_state ) )); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1788,7 +1788,7 @@ int size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = static_cast<char *>(yy_flex_alloc( b->yy_buf_size + 2 )); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1900,7 +1900,7 @@ yy_size_t size; /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + b = static_cast<YY_BUFFER_STATE>(yy_flex_alloc( sizeof( struct yy_buffer_state ) )); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); @@ -1954,7 +1954,7 @@ int len; /* Get memory for full buffer, including space for trailing EOB's. */ n = len + 2; - buf = (char *) yy_flex_alloc( n ); + buf = static_cast<char *>(yy_flex_alloc( n )); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); @@ -2106,7 +2106,7 @@ yy_size_t size; * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ - return (void *) realloc( (char *) ptr, size ); + return (void *) realloc( ptr, size ); } #ifdef YY_USE_PROTOS diff --git a/hwpfilter/source/mzstring.cxx b/hwpfilter/source/mzstring.cxx index 8d72f94ae40e..5fdb802824f9 100644 --- a/hwpfilter/source/mzstring.cxx +++ b/hwpfilter/source/mzstring.cxx @@ -266,7 +266,7 @@ bool MzString::allocate(int len) else { int n = get_alloc_size(len); - char *p = (char *)realloc(Data, n); + char *p = static_cast<char *>(realloc(Data, n)); if (p) { Data = p; @@ -279,7 +279,7 @@ bool MzString::allocate(int len) { // In case we want to add a null. int n = get_alloc_size(len); - Data = (char *)malloc(n); + Data = static_cast<char *>(malloc(n)); if (Data) { Allocated = n; |