Skip to content

Commit 6c1fccf

Browse files
[Manual] Fix errors in converted code.
1 parent c969724 commit 6c1fccf

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

include/jpeglib.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ struct jpeg_memory_mgr {
834834
/* Method pointers */
835835
_Ptr<void *(_Ptr<struct jpeg_common_struct> cinfo, int pool_id, size_t sizeofobject)> alloc_small;
836836
_Ptr<void *(_Ptr<struct jpeg_common_struct> cinfo, int pool_id, size_t sizeofobject)> alloc_large;
837-
_Ptr<_Array_ptr<JSAMPROW> (_Ptr<struct jpeg_common_struct> cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows)> alloc_sarray;
837+
_Ptr<_Array_ptr<JSAMPROW> (_Ptr<struct jpeg_common_struct> cinfo, int pool_id, JDIMENSION samplesperrow, JDIMENSION numrows) : count(numrows)> alloc_sarray;
838838
_Ptr<_Ptr<JBLOCKROW> (_Ptr<struct jpeg_common_struct> cinfo, int pool_id, JDIMENSION blocksperrow, JDIMENSION numrows)> alloc_barray;
839839
_Ptr<_Ptr<struct jvirt_sarray_control> (_Ptr<struct jpeg_common_struct> cinfo, int pool_id, boolean pre_zero, JDIMENSION samplesperrow, JDIMENSION numrows, JDIMENSION maxaccess)> request_virt_sarray;
840840
_Ptr<_Ptr<struct jvirt_barray_control> (_Ptr<struct jpeg_common_struct> cinfo, int pool_id, boolean pre_zero, JDIMENSION blocksperrow, JDIMENSION numrows, JDIMENSION maxaccess)> request_virt_barray;
@@ -924,7 +924,7 @@ extern JHUFF_TBL *jpeg_alloc_huff_table(struct jpeg_common_struct *cinfo : itype
924924

925925
/* Main entry points for compression */
926926
EXTERN(void) jpeg_start_compress(struct jpeg_compress_struct *cinfo : itype(j_compress_ptr), boolean write_all_tables);
927-
EXTERN(JDIMENSION) jpeg_write_scanlines(struct jpeg_compress_struct *cinfo : itype(j_compress_ptr), JSAMPLE *scanlines : itype(JSAMPARRAY), JDIMENSION num_lines);
927+
EXTERN(JDIMENSION) jpeg_write_scanlines(struct jpeg_compress_struct *cinfo : itype(j_compress_ptr), unsigned char **scanlines : itype(JSAMPARRAY), JDIMENSION num_lines);
928928
EXTERN(void) jpeg_finish_compress(struct jpeg_compress_struct *cinfo : itype(j_compress_ptr));
929929

930930
#if JPEG_LIB_VERSION >= 70
@@ -933,7 +933,7 @@ EXTERN(void) jpeg_calc_jpeg_dimensions(struct jpeg_compress_struct *cinfo : ityp
933933
#endif
934934

935935
/* Replaces jpeg_write_scanlines when writing raw downsampled data. */
936-
EXTERN(JDIMENSION) jpeg_write_raw_data(struct jpeg_compress_struct *cinfo : itype(j_compress_ptr), JSAMPLE *data : itype(JSAMPIMAGE), JDIMENSION num_lines);
936+
EXTERN(JDIMENSION) jpeg_write_raw_data(struct jpeg_compress_struct *cinfo : itype(j_compress_ptr), unsigned char ***data : itype(JSAMPIMAGE), JDIMENSION num_lines);
937937

938938
/* Write a special marker. See libjpeg.txt concerning safe usage. */
939939
EXTERN(void) jpeg_write_marker(struct jpeg_compress_struct *cinfo : itype(j_compress_ptr), int marker, const JOCTET *dataptr : itype(_Ptr<const JOCTET>), unsigned int datalen);
@@ -962,13 +962,13 @@ EXTERN(int) jpeg_read_header(struct jpeg_decompress_struct *cinfo : itype(j_deco
962962

963963
/* Main entry points for decompression */
964964
EXTERN(boolean) jpeg_start_decompress(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr));
965-
EXTERN(JDIMENSION) jpeg_read_scanlines(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr), JSAMPLE *scanlines : itype(JSAMPARRAY), JDIMENSION max_lines);
965+
EXTERN(JDIMENSION) jpeg_read_scanlines(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr), unsigned char **scanlines : itype(JSAMPARRAY), JDIMENSION max_lines);
966966
EXTERN(JDIMENSION) jpeg_skip_scanlines(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr), JDIMENSION num_lines);
967967
EXTERN(void) jpeg_crop_scanline(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr), JDIMENSION *xoffset : itype(_Ptr<JDIMENSION>), JDIMENSION *width : itype(_Ptr<JDIMENSION>));
968968
EXTERN(boolean) jpeg_finish_decompress(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr));
969969

970970
/* Replaces jpeg_read_scanlines when reading raw downsampled data. */
971-
EXTERN(JDIMENSION) jpeg_read_raw_data(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr), JSAMPLE *data : itype(JSAMPIMAGE), JDIMENSION max_lines);
971+
EXTERN(JDIMENSION) jpeg_read_raw_data(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr), unsigned char ***data : itype(JSAMPIMAGE), JDIMENSION max_lines);
972972

973973
/* Additional entry points for buffered-image mode. */
974974
EXTERN(boolean) jpeg_has_multiple_scans(struct jpeg_decompress_struct *cinfo : itype(j_decompress_ptr));

to_ppm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ METHODDEF(void)
2626
my_error_exit (j_common_ptr cinfo)
2727
{
2828
/* cinfo->err really points to a my_error_mgr struct, so coerce pointer */
29-
my_error_ptr myerr = (_Ptr<struct my_error_mgr>) cinfo->err;
29+
my_error_ptr myerr = _Dynamic_bounds_cast<_Ptr<struct my_error_mgr>>(cinfo->err);
3030

3131
/* Always display the message. */
3232
/* We could postpone this until after returning, if we chose. */
@@ -58,7 +58,7 @@ read_JPEG_file (_Nt_array_ptr<char> filename)
5858
struct my_error_mgr jerr = {};
5959
/* More stuff */
6060
_Ptr<FILE> infile = ((void *)0); /* source file */
61-
JSAMPARRAY buffer = ((void *)0); /* Output row buffer */
61+
JSAMPARRAY buffer : count(1) = ((void *)0); /* Output row buffer */
6262
int row_stride; /* physical row width in output buffer */
6363

6464
/* In this example we want to open the input file before doing anything else,

0 commit comments

Comments
 (0)