Merge to XFA: Kill FXSYS_mem{cpy,cmp,set.move}{32,8}.
[pdfium.git] / core / src / fxcodec / lbmp / fx_bmp.cpp
index 986a327..7553ec7 100644 (file)
@@ -37,7 +37,7 @@ bmp_decompress_struct_p _bmp_create_decompress()
     if(bmp_ptr == NULL) {\r
         return NULL;\r
     }\r
-    FXSYS_memset32(bmp_ptr, 0, sizeof(bmp_decompress_struct));\r
+    FXSYS_memset(bmp_ptr, 0, sizeof(bmp_decompress_struct));\r
     bmp_ptr->decode_status = BMP_D_STATUS_HEADER;\r
     bmp_ptr->bmp_header_ptr = FX_Alloc(BmpFileHeader, 1);\r
     return bmp_ptr;\r
@@ -199,7 +199,7 @@ int32_t _bmp_read_header(bmp_decompress_struct_p bmp_ptr)
         }\r
         bmp_ptr->out_row_buffer = FX_Alloc(uint8_t, bmp_ptr->out_row_bytes);\r
         BMP_PTR_NOT_NULL(bmp_ptr->out_row_buffer, bmp_ptr);\r
-        FXSYS_memset32(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
+        FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
         _bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_PAL);\r
     }\r
     if (bmp_ptr->decode_status == BMP_D_STATUS_PAL) {\r
@@ -362,7 +362,7 @@ int32_t _bmp_decode_rgb(bmp_decompress_struct_p bmp_ptr)
             case 8:\r
             case 24:\r
             case 32:\r
-                FXSYS_memcpy32(bmp_ptr->out_row_buffer, des_buf, bmp_ptr->src_row_bytes);\r
+                FXSYS_memcpy(bmp_ptr->out_row_buffer, des_buf, bmp_ptr->src_row_bytes);\r
                 break;\r
         }\r
         row_buf = bmp_ptr->out_row_buffer;\r
@@ -400,7 +400,7 @@ int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
                                                          bmp_ptr->imgTB_flag ? bmp_ptr->row_num++ : (bmp_ptr->height - 1 - bmp_ptr->row_num++),\r
                                                          bmp_ptr->out_row_buffer);\r
                                 bmp_ptr->col_num = 0;\r
-                                FXSYS_memset32(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
+                                FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
                                 _bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_DATA);\r
                                 continue;\r
                             }\r
@@ -426,7 +426,7 @@ int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
                                     return 0;\r
                                 }\r
                                 while(bmp_ptr->row_num < bmp_row_num_next) {\r
-                                    FXSYS_memset32(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
+                                    FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
                                     bmp_ptr->_bmp_get_row_fn(bmp_ptr,\r
                                                              bmp_ptr->imgTB_flag ? bmp_ptr->row_num++ : (bmp_ptr->height - 1 - bmp_ptr->row_num++),\r
                                                              bmp_ptr->out_row_buffer);\r
@@ -443,7 +443,7 @@ int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
                                     bmp_ptr->skip_size = skip_size_org;\r
                                     return 2;\r
                                 }\r
-                                FXSYS_memcpy32(bmp_ptr->out_row_buffer + bmp_ptr->col_num, second_byte_ptr, *first_byte_ptr);\r
+                                FXSYS_memcpy(bmp_ptr->out_row_buffer + bmp_ptr->col_num, second_byte_ptr, *first_byte_ptr);\r
                                 bmp_ptr->col_num += (int32_t)(*first_byte_ptr);\r
                             }\r
                     }\r
@@ -458,7 +458,7 @@ int32_t _bmp_decode_rle8(bmp_decompress_struct_p bmp_ptr)
                         _bmp_error(bmp_ptr, "The Bmp File Is Corrupt");\r
                         return 0;\r
                     }\r
-                    FXSYS_memset8(bmp_ptr->out_row_buffer + bmp_ptr->col_num, *second_byte_ptr, *first_byte_ptr);\r
+                    FXSYS_memset(bmp_ptr->out_row_buffer + bmp_ptr->col_num, *second_byte_ptr, *first_byte_ptr);\r
                     bmp_ptr->col_num += (int32_t)(*first_byte_ptr);\r
                 }\r
         }\r
@@ -493,7 +493,7 @@ int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr)
                                                          bmp_ptr->imgTB_flag ? bmp_ptr->row_num++ : (bmp_ptr->height - 1 - bmp_ptr->row_num++),\r
                                                          bmp_ptr->out_row_buffer);\r
                                 bmp_ptr->col_num = 0;\r
-                                FXSYS_memset32(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
+                                FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
                                 _bmp_save_decoding_status(bmp_ptr, BMP_D_STATUS_DATA);\r
                                 continue;\r
                             }\r
@@ -519,7 +519,7 @@ int32_t _bmp_decode_rle4(bmp_decompress_struct_p bmp_ptr)
                                     return 0;\r
                                 }\r
                                 while(bmp_ptr->row_num < bmp_row_num_next) {\r
-                                    FXSYS_memset32(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
+                                    FXSYS_memset(bmp_ptr->out_row_buffer, 0, bmp_ptr->out_row_bytes);\r
                                     bmp_ptr->_bmp_get_row_fn(bmp_ptr,\r
                                                              bmp_ptr->imgTB_flag ? bmp_ptr->row_num++ : (bmp_ptr->height - 1 - bmp_ptr->row_num++),\r
                                                              bmp_ptr->out_row_buffer);\r
@@ -614,7 +614,7 @@ bmp_compress_struct_p _bmp_create_compress()
     bmp_compress_struct_p bmp_ptr;\r
     bmp_ptr = FX_Alloc(bmp_compress_struct, 1);\r
     if (bmp_ptr) {\r
-        FXSYS_memset32(bmp_ptr, 0, sizeof(bmp_compress_struct));\r
+        FXSYS_memset(bmp_ptr, 0, sizeof(bmp_compress_struct));\r
     }\r
     return bmp_ptr;\r
 }\r
@@ -683,7 +683,7 @@ static void _bmp_encode_bitfields(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_b
     if (dst_buf == NULL) {\r
         return;\r
     }\r
-    FXSYS_memset32(&dst_buf[dst_pos], 0, size);\r
+    FXSYS_memset(&dst_buf[dst_pos], 0, size);\r
     FX_DWORD           mask_red;\r
     FX_DWORD           mask_green;\r
     FX_DWORD           mask_blue;\r
@@ -770,9 +770,9 @@ static void _bmp_encode_rgb(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, FX
     if (dst_buf == NULL) {\r
         return;\r
     }\r
-    FXSYS_memset32(&dst_buf[dst_pos], 0, size);\r
+    FXSYS_memset(&dst_buf[dst_pos], 0, size);\r
     for (int32_t row_num = bmp_ptr->src_row - 1; row_num > -1; row_num--) {\r
-        FXSYS_memcpy32(&dst_buf[dst_pos], &bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch], bmp_ptr->src_pitch);\r
+        FXSYS_memcpy(&dst_buf[dst_pos], &bmp_ptr->src_buf[row_num * bmp_ptr->src_pitch], bmp_ptr->src_pitch);\r
         dst_pos += dst_pitch;\r
     }\r
     dst_size = dst_pos;\r
@@ -800,7 +800,7 @@ static void _bmp_encode_rle8(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, F
     if (dst_buf == NULL) {\r
         return;\r
     }\r
-    FXSYS_memset32(&dst_buf[dst_pos], 0, size);\r
+    FXSYS_memset(&dst_buf[dst_pos], 0, size);\r
     for (int32_t row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1; ) {\r
         index = row_num * bmp_ptr->src_pitch;\r
         rle[0] = _bmp_rle8_search(&bmp_ptr->src_buf[index + i], size - index - i);\r
@@ -848,7 +848,7 @@ static void _bmp_encode_rle4(bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, F
     if (dst_buf == NULL) {\r
         return;\r
     }\r
-    FXSYS_memset32(&dst_buf[dst_pos], 0, size);\r
+    FXSYS_memset(&dst_buf[dst_pos], 0, size);\r
     for (int32_t row_num = bmp_ptr->src_row - 1, i = 0; row_num > -1; rle[1] = 0) {\r
         index = row_num * bmp_ptr->src_pitch;\r
         rle[0] = _bmp_rle4_search(&bmp_ptr->src_buf[index + i], size - index - i);\r
@@ -886,10 +886,10 @@ FX_BOOL _bmp_encode_image( bmp_compress_struct_p bmp_ptr, uint8_t*& dst_buf, FX_
     if (dst_buf == NULL) {\r
         return FALSE;\r
     }\r
-    FXSYS_memset32(dst_buf, 0, dst_size);\r
+    FXSYS_memset(dst_buf, 0, dst_size);\r
     bmp_ptr->file_header.bfOffBits = head_size;\r
     if (bmp_ptr->pal_ptr && pal_size) {\r
-        FXSYS_memcpy32(&dst_buf[head_size], bmp_ptr->pal_ptr, pal_size);\r
+        FXSYS_memcpy(&dst_buf[head_size], bmp_ptr->pal_ptr, pal_size);\r
         bmp_ptr->file_header.bfOffBits += pal_size;\r
     }\r
     WriteInfoHeader(&bmp_ptr->info_header, dst_buf);\r