Merge to XFA: Remove typdefs for pointer types in fx_system.h.
[pdfium.git] / core / src / fxcodec / lbmp / fx_bmp.cpp
index 3a6e381..986a327 100644 (file)
@@ -5,27 +5,27 @@
 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
 \r
 #include "fx_bmp.h"\r
-FX_DWORD _GetDWord_LSBFirst(FX_LPBYTE p)\r
+FX_DWORD _GetDWord_LSBFirst(uint8_t* p)\r
 {\r
     return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);\r
 }\r
-FX_WORD _GetWord_LSBFirst(FX_LPBYTE p)\r
+FX_WORD _GetWord_LSBFirst(uint8_t* p)\r
 {\r
     return p[0] | (p[1] << 8);\r
 }\r
-void _SetDWord_LSBFirst(FX_LPBYTE p, FX_DWORD v)\r
+void _SetDWord_LSBFirst(uint8_t* p, FX_DWORD v)\r
 {\r
     p[0] = (uint8_t)v;\r
     p[1] = (uint8_t)(v >> 8);\r
     p[2] = (uint8_t)(v >> 16);\r
     p[3] = (uint8_t)(v >> 24);\r
 }\r
-void _SetWord_LSBFirst(FX_LPBYTE p, FX_WORD v)\r
+void _SetWord_LSBFirst(uint8_t* p, FX_WORD v)\r
 {\r
     p[0] = (uint8_t)v;\r
     p[1] = (uint8_t)(v >> 8);\r
 }\r
-void _bmp_error(bmp_decompress_struct_p bmp_ptr, FX_LPCSTR err_msg)\r
+void _bmp_error(bmp_decompress_struct_p bmp_ptr, const FX_CHAR* err_msg)\r
 {\r
     if(bmp_ptr != NULL && bmp_ptr->_bmp_error_fn != NULL) {\r
         bmp_ptr->_bmp_error_fn(bmp_ptr, err_msg);\r
@@ -69,12 +69,12 @@ int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
     if(bmp_ptr->decode_status == BMP_D_STATUS_HEADER) {\r
         ASSERT(sizeof(BmpFileHeader) == 14);\r
         BmpFileHeader* bmp_header_ptr = NULL;\r
-        if(_bmp_read_data(bmp_ptr, (FX_LPBYTE*)&bmp_header_ptr, 14) == NULL) {\r
+        if(_bmp_read_data(bmp_ptr, (uint8_t**)&bmp_header_ptr, 14) == NULL) {\r
             return 2;\r
         }\r
-        bmp_ptr->bmp_header_ptr->bfType = _GetWord_LSBFirst((FX_LPBYTE)&bmp_header_ptr->bfType);\r
-        bmp_ptr->bmp_header_ptr->bfOffBits = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_header_ptr->bfOffBits);\r
-        bmp_ptr->data_size = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_header_ptr->bfSize);\r
+        bmp_ptr->bmp_header_ptr->bfType = _GetWord_LSBFirst((uint8_t*)&bmp_header_ptr->bfType);\r
+        bmp_ptr->bmp_header_ptr->bfOffBits = _GetDWord_LSBFirst((uint8_t*)&bmp_header_ptr->bfOffBits);\r
+        bmp_ptr->data_size = _GetDWord_LSBFirst((uint8_t*)&bmp_header_ptr->bfSize);\r
         if(bmp_ptr->bmp_header_ptr->bfType != BMP_SIGNATURE) {\r
             _bmp_error(bmp_ptr, "Not A Bmp Image");\r
             return 0;\r
@@ -91,30 +91,30 @@ int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
             case FX_MIN(12, sizeof(BmpCoreHeader)): {\r
                     bmp_ptr->pal_type = 1;\r
                     BmpCoreHeaderPtr bmp_core_header_ptr = NULL;\r
-                    if(_bmp_read_data(bmp_ptr, (FX_LPBYTE*)&bmp_core_header_ptr, bmp_ptr->img_ifh_size) == NULL) {\r
+                    if(_bmp_read_data(bmp_ptr, (uint8_t**)&bmp_core_header_ptr, bmp_ptr->img_ifh_size) == NULL) {\r
                         bmp_ptr->skip_size = skip_size_org;\r
                         return 2;\r
                     }\r
-                    bmp_ptr->width = (FX_DWORD)_GetWord_LSBFirst((FX_LPBYTE)&bmp_core_header_ptr->bcWidth);\r
-                    bmp_ptr->height = (FX_DWORD)_GetWord_LSBFirst((FX_LPBYTE)&bmp_core_header_ptr->bcHeight);\r
-                    bmp_ptr->bitCounts = _GetWord_LSBFirst((FX_LPBYTE)&bmp_core_header_ptr->bcBitCount);\r
+                    bmp_ptr->width = (FX_DWORD)_GetWord_LSBFirst((uint8_t*)&bmp_core_header_ptr->bcWidth);\r
+                    bmp_ptr->height = (FX_DWORD)_GetWord_LSBFirst((uint8_t*)&bmp_core_header_ptr->bcHeight);\r
+                    bmp_ptr->bitCounts = _GetWord_LSBFirst((uint8_t*)&bmp_core_header_ptr->bcBitCount);\r
                     bmp_ptr->compress_flag = BMP_RGB;\r
                     bmp_ptr->imgTB_flag = FALSE;\r
                 }\r
                 break;\r
             case FX_MIN(40, sizeof(BmpInfoHeader)): {\r
                     BmpInfoHeaderPtr bmp_info_header_ptr = NULL;\r
-                    if(_bmp_read_data(bmp_ptr, (FX_LPBYTE*)&bmp_info_header_ptr, bmp_ptr->img_ifh_size) == NULL) {\r
+                    if(_bmp_read_data(bmp_ptr, (uint8_t**)&bmp_info_header_ptr, bmp_ptr->img_ifh_size) == NULL) {\r
                         bmp_ptr->skip_size = skip_size_org;\r
                         return 2;\r
                     }\r
-                    bmp_ptr->width = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biWidth);\r
-                    bmp_ptr->height = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biHeight);\r
-                    bmp_ptr->bitCounts = _GetWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biBitCount);\r
-                    bmp_ptr->compress_flag = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biCompression);\r
-                    bmp_ptr->color_used = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biClrUsed);\r
-                    bmp_ptr->dpi_x = (int32_t)_GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biXPelsPerMeter);\r
-                    bmp_ptr->dpi_y = (int32_t)_GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biYPelsPerMeter);\r
+                    bmp_ptr->width = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biWidth);\r
+                    bmp_ptr->height = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biHeight);\r
+                    bmp_ptr->bitCounts = _GetWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biBitCount);\r
+                    bmp_ptr->compress_flag = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biCompression);\r
+                    bmp_ptr->color_used = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biClrUsed);\r
+                    bmp_ptr->dpi_x = (int32_t)_GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biXPelsPerMeter);\r
+                    bmp_ptr->dpi_y = (int32_t)_GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biYPelsPerMeter);\r
                     if(bmp_ptr->height < 0) {\r
                         bmp_ptr->height = -bmp_ptr->height;\r
                         bmp_ptr->imgTB_flag = TRUE;\r
@@ -124,19 +124,19 @@ int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
             default: {\r
                     if(bmp_ptr->img_ifh_size > FX_MIN(40, sizeof(BmpInfoHeader))) {\r
                         BmpInfoHeaderPtr bmp_info_header_ptr = NULL;\r
-                        if(_bmp_read_data(bmp_ptr, (FX_LPBYTE*)&bmp_info_header_ptr, bmp_ptr->img_ifh_size) == NULL) {\r
+                        if(_bmp_read_data(bmp_ptr, (uint8_t**)&bmp_info_header_ptr, bmp_ptr->img_ifh_size) == NULL) {\r
                             bmp_ptr->skip_size = skip_size_org;\r
                             return 2;\r
                         }\r
                         FX_WORD biPlanes;\r
-                        bmp_ptr->width = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biWidth);\r
-                        bmp_ptr->height = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biHeight);\r
-                        bmp_ptr->bitCounts = _GetWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biBitCount);\r
-                        bmp_ptr->compress_flag = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biCompression);\r
-                        bmp_ptr->color_used = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biClrUsed);\r
-                        biPlanes = _GetWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biPlanes);\r
-                        bmp_ptr->dpi_x = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biXPelsPerMeter);\r
-                        bmp_ptr->dpi_y = _GetDWord_LSBFirst((FX_LPBYTE)&bmp_info_header_ptr->biYPelsPerMeter);\r
+                        bmp_ptr->width = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biWidth);\r
+                        bmp_ptr->height = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biHeight);\r
+                        bmp_ptr->bitCounts = _GetWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biBitCount);\r
+                        bmp_ptr->compress_flag = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biCompression);\r
+                        bmp_ptr->color_used = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biClrUsed);\r
+                        biPlanes = _GetWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biPlanes);\r
+                        bmp_ptr->dpi_x = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biXPelsPerMeter);\r
+                        bmp_ptr->dpi_y = _GetDWord_LSBFirst((uint8_t*)&bmp_info_header_ptr->biYPelsPerMeter);\r
                         if(bmp_ptr->height < 0) {\r
                             bmp_ptr->height = -bmp_ptr->height;\r
                             bmp_ptr->imgTB_flag = TRUE;\r
@@ -211,13 +211,13 @@ int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
                 return 0;\r
             }\r
             FX_DWORD* mask;\r
-            if(_bmp_read_data(bmp_ptr, (FX_LPBYTE*)&mask, 3 * sizeof(FX_DWORD)) == NULL) {\r
+            if(_bmp_read_data(bmp_ptr, (uint8_t**)&mask, 3 * sizeof(FX_DWORD)) == NULL) {\r
                 bmp_ptr->skip_size = skip_size_org;\r
                 return 2;\r
             }\r
-            bmp_ptr->mask_red  = _GetDWord_LSBFirst((FX_LPBYTE)&mask[0]);\r
-            bmp_ptr->mask_green        = _GetDWord_LSBFirst((FX_LPBYTE)&mask[1]);\r
-            bmp_ptr->mask_blue = _GetDWord_LSBFirst((FX_LPBYTE)&mask[2]);\r
+            bmp_ptr->mask_red  = _GetDWord_LSBFirst((uint8_t*)&mask[0]);\r
+            bmp_ptr->mask_green        = _GetDWord_LSBFirst((uint8_t*)&mask[1]);\r
+            bmp_ptr->mask_blue = _GetDWord_LSBFirst((uint8_t*)&mask[2]);\r
             if(bmp_ptr->mask_red & bmp_ptr->mask_green ||\r
                     bmp_ptr->mask_red & bmp_ptr->mask_blue ||\r
                     bmp_ptr->mask_green & bmp_ptr->mask_blue) {\r
@@ -246,9 +246,9 @@ int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
             if(bmp_ptr->color_used != 0) {\r
                 bmp_ptr->pal_num = bmp_ptr->color_used;\r
             }\r
-            FX_LPBYTE src_pal_ptr = NULL;\r
+            uint8_t* src_pal_ptr = NULL;\r
             FX_DWORD src_pal_size = bmp_ptr->pal_num * (bmp_ptr->pal_type ? 3 : 4);\r
-            if(_bmp_read_data(bmp_ptr, (FX_LPBYTE*)&src_pal_ptr, src_pal_size) == NULL) {\r
+            if(_bmp_read_data(bmp_ptr, (uint8_t**)&src_pal_ptr, src_pal_size) == NULL) {\r
                 bmp_ptr->skip_size = skip_size_org;\r
                 return 2;\r
             }\r
@@ -306,8 +306,8 @@ int32_t _bmp_decode_image(bmp_decompress_struct_p bmp_ptr)
 }\r
 int32_t _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr)\r
 {\r
-    FX_LPBYTE row_buf = bmp_ptr->out_row_buffer;\r
-    FX_LPBYTE des_buf = NULL;\r
+    uint8_t* row_buf = bmp_ptr->out_row_buffer;\r
+    uint8_t* des_buf = NULL;\r
     while (bmp_ptr->row_num < bmp_ptr->height) {\r
         if(_bmp_read_data(bmp_ptr, &des_buf, bmp_ptr->src_row_bytes) == NULL) {\r
             return 2;\r
@@ -351,7 +351,7 @@ int32_t _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr)
                     green_bits -= 8;\r
                     red_bits -= 8;\r
                     for (int32_t col = 0; col < bmp_ptr->width; col++) {\r
-                        *buf = _GetWord_LSBFirst((FX_LPBYTE)buf);\r
+                        *buf = _GetWord_LSBFirst((uint8_t*)buf);\r
                         *row_buf++ = (uint8_t)((*buf & bmp_ptr->mask_blue) << blue_bits);\r
                         *row_buf++ = (uint8_t)((*buf & bmp_ptr->mask_green) >> green_bits);\r
                         *row_buf++ = (uint8_t)((*buf++ & bmp_ptr->mask_red) >> red_bits);\r
@@ -375,8 +375,8 @@ int32_t _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr)
 }\r
 int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)\r
 {\r
-    FX_LPBYTE first_byte_ptr = NULL;\r
-    FX_LPBYTE second_byte_ptr = NULL;\r
+    uint8_t* first_byte_ptr = NULL;\r
+    uint8_t* second_byte_ptr = NULL;\r
     bmp_ptr->col_num = 0;\r
     while(TRUE) {\r
         FX_DWORD skip_size_org = bmp_ptr->skip_size;\r
@@ -414,7 +414,7 @@ int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
                                 return 1;\r
                             }\r
                         case RLE_DELTA: {\r
-                                FX_LPBYTE delta_ptr;\r
+                                uint8_t* delta_ptr;\r
                                 if(_bmp_read_data(bmp_ptr, &delta_ptr, 2) == NULL) {\r
                                     bmp_ptr->skip_size = skip_size_org;\r
                                     return 2;\r
@@ -468,8 +468,8 @@ int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
 }\r
 int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr)\r
 {\r
-    FX_LPBYTE first_byte_ptr = NULL;\r
-    FX_LPBYTE second_byte_ptr = NULL;\r
+    uint8_t* first_byte_ptr = NULL;\r
+    uint8_t* second_byte_ptr = NULL;\r
     bmp_ptr->col_num = 0;\r
     while (TRUE) {\r
         FX_DWORD skip_size_org = bmp_ptr->skip_size;\r
@@ -507,7 +507,7 @@ int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr)
                                 return 1;\r
                             }\r
                         case RLE_DELTA: {\r
-                                FX_LPBYTE delta_ptr;\r
+                                uint8_t* delta_ptr;\r
                                 if(_bmp_read_data(bmp_ptr, &delta_ptr, 2) == NULL) {\r
                                     bmp_ptr->skip_size = skip_size_org;\r
                                     return 2;\r
@@ -576,7 +576,7 @@ int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr)
     _bmp_error(bmp_ptr, "Any Uncontrol Error");\r
     return 0;\r
 }\r
-FX_LPBYTE _bmp_read_data(bmp_decompress_struct_p bmp_ptr, FX_LPBYTE* des_buf_pp, FX_DWORD data_size)\r
+uint8_t* _bmp_read_data(bmp_decompress_struct_p bmp_ptr, uint8_t** des_buf_pp, FX_DWORD data_size)\r
 {\r
     if(bmp_ptr == NULL ||\r
             bmp_ptr->avail_in < bmp_ptr->skip_size + data_size) {\r
@@ -593,13 +593,13 @@ void _bmp_save_decoding_status(bmp_decompress_struct_p bmp_ptr, int32_t status)
     bmp_ptr->avail_in -= bmp_ptr->skip_size;\r
     bmp_ptr->skip_size = 0;\r
 }\r
-void _bmp_input_buffer(bmp_decompress_struct_p bmp_ptr, FX_LPBYTE src_buf, FX_DWORD src_size)\r
+void _bmp_input_buffer(bmp_decompress_struct_p bmp_ptr, uint8_t* src_buf, FX_DWORD src_size)\r
 {\r
     bmp_ptr->next_in = src_buf;\r
     bmp_ptr->avail_in = src_size;\r
     bmp_ptr->skip_size = 0;\r
 }\r
-FX_DWORD _bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr, FX_LPBYTE* avial_buf_ptr)\r
+FX_DWORD _bmp_get_avail_input(bmp_decompress_struct_p bmp_ptr, uint8_t** avial_buf_ptr)\r
 {\r
     if(avial_buf_ptr != NULL) {\r
         *avial_buf_ptr = NULL;\r
@@ -627,7 +627,7 @@ void _bmp_destroy_compress(bmp_compress_struct_p bmp_ptr)
         FX_Free(bmp_ptr);\r
     }\r
 }\r
-static void WriteFileHeader(BmpFileHeaderPtr head_ptr, FX_LPBYTE dst_buf)\r
+static void WriteFileHeader(BmpFileHeaderPtr head_ptr, uint8_t* dst_buf)\r
 {\r
     FX_DWORD offset;\r
     offset = 0;\r
@@ -642,7 +642,7 @@ static void WriteFileHeader(BmpFileHeaderPtr head_ptr, FX_LPBYTE dst_buf)
     _SetDWord_LSBFirst(&dst_buf[offset], head_ptr->bfOffBits);\r
     offset += 4;\r
 }\r
-static void WriteInfoHeader(BmpInfoHeaderPtr info_head_ptr, FX_LPBYTE dst_buf)\r
+static void WriteInfoHeader(BmpInfoHeaderPtr info_head_ptr, uint8_t* dst_buf)\r
 {\r
     FX_DWORD offset;\r
     offset = sizeof(BmpFileHeader);\r
@@ -670,7 +670,7 @@ static void WriteInfoHeader(BmpInfoHeaderPtr info_head_ptr, FX_LPBYTE dst_buf)
     offset += 4;\r
 }\r
 #ifdef BMP_SUPPORT_BITFIELD\r
-static void _bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_size)\r
+static void _bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, FX_DWORD& dst_size)\r
 {\r
     if (bmp_ptr->info_header.biBitCount != 16 && bmp_ptr->info_header.biBitCount != 32) {\r
         return;\r
@@ -753,7 +753,7 @@ static void _bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_
     dst_size = dst_pos;\r
 }\r
 #endif\r
-static void _bmp_encode_rgb(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_size)\r
+static void _bmp_encode_rgb(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, FX_DWORD& dst_size)\r
 {\r
     if (bmp_ptr->info_header.biBitCount == 16) {\r
 #ifdef BMP_SUPPORT_BITFIELD\r
@@ -777,7 +777,7 @@ static void _bmp_encode_rgb(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, F
     }\r
     dst_size = dst_pos;\r
 }\r
-static uint8_t _bmp_rle8_search(FX_LPCBYTE buf, int32_t len)\r
+static uint8_t _bmp_rle8_search(const uint8_t* buf, int32_t len)\r
 {\r
     uint8_t num;\r
     num = 1;\r
@@ -789,7 +789,7 @@ static uint8_t _bmp_rle8_search(FX_LPCBYTE buf, int32_t len)
     }\r
     return num;\r
 }\r
-static void _bmp_encode_rle8(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_size)\r
+static void _bmp_encode_rle8(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, FX_DWORD& dst_size)\r
 {\r
     FX_DWORD size, dst_pos, index;\r
     uint8_t rle[2] = {0};\r
@@ -825,7 +825,7 @@ static void _bmp_encode_rle8(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf,
     dst_buf[dst_pos++] = RLE_EOI;\r
     dst_size = dst_pos;\r
 }\r
-static uint8_t _bmp_rle4_search(FX_LPCBYTE buf, int32_t len)\r
+static uint8_t _bmp_rle4_search(const uint8_t* buf, int32_t len)\r
 {\r
     uint8_t num;\r
     num = 2;\r
@@ -837,7 +837,7 @@ static uint8_t _bmp_rle4_search(FX_LPCBYTE buf, int32_t len)
     }\r
     return num;\r
 }\r
-static void _bmp_encode_rle4(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_size)\r
+static void _bmp_encode_rle4(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, FX_DWORD& dst_size)\r
 {\r
     FX_DWORD size, dst_pos, index;\r
     uint8_t rle[2] = {0};\r
@@ -874,7 +874,7 @@ static void _bmp_encode_rle4(bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf,
     dst_buf[dst_pos++] = RLE_EOI;\r
     dst_size = dst_pos;\r
 }\r
-FX_BOOL _bmp_encode_image( bmp_compress_struct_p bmp_ptr, FX_LPBYTE& dst_buf, FX_DWORD& dst_size )\r
+FX_BOOL _bmp_encode_image( bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, FX_DWORD& dst_size )\r
 {\r
     FX_DWORD head_size = sizeof(BmpFileHeader) + sizeof(BmpInfoHeader);\r
     FX_DWORD pal_size = sizeof(FX_DWORD) * bmp_ptr->pal_num;\r