diff options
author | Campbell Barton <campbell@blender.org> | 2022-05-05 03:41:00 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-05-05 03:44:25 +0300 |
commit | d0c2fd05701056d545cce0e6b44260c4fe071bcb (patch) | |
tree | e11cdb47af2eb0c0d6faec740e31802d1eb76eb9 /source | |
parent | d3c895fc41d7a2d4ec677c4cd70f656a28f8edb1 (diff) |
Cleanup: use 'r_' prefix for return arguments
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/subdiv_converter_mesh.c | 20 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/tracking_plane_tracker.c | 6 | ||||
-rw-r--r-- | source/blender/imbuf/intern/IMB_filetype.h | 18 | ||||
-rw-r--r-- | source/blender/imbuf/intern/jpeg.c | 24 | ||||
-rw-r--r-- | source/blender/imbuf/intern/readimage.c | 2 |
5 files changed, 36 insertions, 34 deletions
diff --git a/source/blender/blenkernel/intern/subdiv_converter_mesh.c b/source/blender/blenkernel/intern/subdiv_converter_mesh.c index 1c5078df1f3..12a5f00a68b 100644 --- a/source/blender/blenkernel/intern/subdiv_converter_mesh.c +++ b/source/blender/blenkernel/intern/subdiv_converter_mesh.c @@ -295,16 +295,16 @@ static void init_functions(OpenSubdiv_Converter *converter) static void initialize_manifold_index_array(const BLI_bitmap *used_map, const int num_elements, - int **indices_r, - int **indices_reverse_r, - int *num_manifold_elements_r) + int **r_indices, + int **r_indices_reverse, + int *r_num_manifold_elements) { int *indices = NULL; - if (indices_r != NULL) { + if (r_indices != NULL) { indices = MEM_malloc_arrayN(num_elements, sizeof(int), "manifold indices"); } int *indices_reverse = NULL; - if (indices_reverse_r != NULL) { + if (r_indices_reverse != NULL) { indices_reverse = MEM_malloc_arrayN(num_elements, sizeof(int), "manifold indices reverse"); } int offset = 0; @@ -324,13 +324,13 @@ static void initialize_manifold_index_array(const BLI_bitmap *used_map, offset++; } } - if (indices_r != NULL) { - *indices_r = indices; + if (r_indices != NULL) { + *r_indices = indices; } - if (indices_reverse_r != NULL) { - *indices_reverse_r = indices_reverse; + if (r_indices_reverse != NULL) { + *r_indices_reverse = indices_reverse; } - *num_manifold_elements_r = num_elements - offset; + *r_num_manifold_elements = num_elements - offset; } static void initialize_manifold_indices(ConverterStorage *storage) diff --git a/source/blender/blenkernel/intern/tracking_plane_tracker.c b/source/blender/blenkernel/intern/tracking_plane_tracker.c index 5e60f6f59a9..c4379ea61bc 100644 --- a/source/blender/blenkernel/intern/tracking_plane_tracker.c +++ b/source/blender/blenkernel/intern/tracking_plane_tracker.c @@ -21,12 +21,12 @@ typedef double Vec2[2]; static int point_markers_correspondences_on_both_image( - MovieTrackingPlaneTrack *plane_track, int frame1, int frame2, Vec2 **x1_r, Vec2 **x2_r) + MovieTrackingPlaneTrack *plane_track, int frame1, int frame2, Vec2 **r_x1, Vec2 **r_x2) { Vec2 *x1, *x2; - *x1_r = x1 = MEM_mallocN(sizeof(*x1) * plane_track->point_tracksnr, "point correspondences x1"); - *x2_r = x2 = MEM_mallocN(sizeof(*x1) * plane_track->point_tracksnr, "point correspondences x2"); + *r_x1 = x1 = MEM_mallocN(sizeof(*x1) * plane_track->point_tracksnr, "point correspondences x1"); + *r_x2 = x2 = MEM_mallocN(sizeof(*x1) * plane_track->point_tracksnr, "point correspondences x2"); int correspondence_index = 0; for (int i = 0; i < plane_track->point_tracksnr; i++) { diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h index bcca6f9fd85..67d1aefeacb 100644 --- a/source/blender/imbuf/intern/IMB_filetype.h +++ b/source/blender/imbuf/intern/IMB_filetype.h @@ -36,15 +36,17 @@ typedef struct ImFileType { char colorspace[IM_MAX_SPACE]); /** Load an image from a file. */ struct ImBuf *(*load_filepath)(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]); - /** Load/Create a thumbnail image from a filepath. `max_thumb_size` is maximum size of either + /** + * Load/Create a thumbnail image from a filepath. `max_thumb_size` is maximum size of either * dimension, so can return less on either or both. Should, if possible and performant, return - * dimensions of the full-size image in width_r & height_r. */ + * dimensions of the full-size image in r_width & r_height. + */ struct ImBuf *(*load_filepath_thumbnail)(const char *filepath, const int flags, const size_t max_thumb_size, - size_t *width_r, - size_t *height_r, - char colorspace[IM_MAX_SPACE]); + char colorspace[IM_MAX_SPACE], + size_t *r_width, + size_t *r_height); /** Save to a file (or memory if #IB_mem is set in `flags` and the format supports it). */ bool (*save)(struct ImBuf *ibuf, const char *filepath, int flags); void (*load_tile)(struct ImBuf *ibuf, @@ -155,9 +157,9 @@ struct ImBuf *imb_load_jpeg(const unsigned char *buffer, struct ImBuf *imb_thumbnail_jpeg(const char *filepath, const int flags, const size_t max_thumb_size, - size_t *width_r, - size_t *height_r, - char colorspace[IM_MAX_SPACE]); + char colorspace[IM_MAX_SPACE], + size_t *r_width, + size_t *r_height); /** \} */ diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index d76bd00df57..80fcceb0aa7 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -42,8 +42,8 @@ static boolean handle_app1(j_decompress_ptr cinfo); static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, int flags, int max_size, - size_t *width_r, - size_t *height_r); + size_t *r_width, + size_t *r_height); static const uchar jpeg_default_quality = 75; static uchar ibuf_quality; @@ -253,8 +253,8 @@ static boolean handle_app1(j_decompress_ptr cinfo) static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, int flags, int max_size, - size_t *width_r, - size_t *height_r) + size_t *r_width, + size_t *r_height) { JSAMPARRAY row_pointer; JSAMPLE *buffer = NULL; @@ -278,11 +278,11 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo, cinfo->out_color_space = JCS_CMYK; } - if (width_r) { - *width_r = cinfo->image_width; + if (r_width) { + *r_width = cinfo->image_width; } - if (height_r) { - *height_r = cinfo->image_height; + if (r_height) { + *r_height = cinfo->image_height; } if (max_size > 0) { @@ -489,9 +489,9 @@ ImBuf *imb_load_jpeg(const unsigned char *buffer, struct ImBuf *imb_thumbnail_jpeg(const char *filepath, const int flags, const size_t max_thumb_size, - size_t *width_r, - size_t *height_r, - char colorspace[IM_MAX_SPACE]) + char colorspace[IM_MAX_SPACE], + size_t *r_width, + size_t *r_height) { struct jpeg_decompress_struct _cinfo, *cinfo = &_cinfo; struct my_error_mgr jerr; @@ -550,7 +550,7 @@ struct ImBuf *imb_thumbnail_jpeg(const char *filepath, jpeg_create_decompress(cinfo); jpeg_stdio_src(cinfo, infile); - ImBuf *ibuf = ibJpegImageFromCinfo(cinfo, flags, max_thumb_size, width_r, height_r); + ImBuf *ibuf = ibJpegImageFromCinfo(cinfo, flags, max_thumb_size, r_width, r_height); fclose(infile); return ibuf; diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index 81347bce588..805a7e8d687 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -258,7 +258,7 @@ struct ImBuf *IMB_thumb_load_image(const char *filepath, if (type->load_filepath_thumbnail) { ibuf = type->load_filepath_thumbnail( - filepath, flags, max_thumb_size, &width, &height, colorspace); + filepath, flags, max_thumb_size, colorspace, &width, &height); } else { /* Skip images of other types if over 100MB. */ |