Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-09-25 10:04:52 +0300
committerCampbell Barton <campbell@blender.org>2022-09-25 11:26:27 +0300
commit891949cbb47143420f4324cb60efc05ef5d70b39 (patch)
treefe70a45612ae96f9ce1f37378ef5ff035d3127f5 /source/blender/io
parentc9e35c2ced92082c86f1ecb9ecd16c6230218c7c (diff)
Cleanup: use 'u' prefixed integer types for brevity & cast style
To use function style cast '(unsigned char)x' can't be replaced by 'unsigned char(x)'.
Diffstat (limited to 'source/blender/io')
-rw-r--r--source/blender/io/alembic/exporter/abc_archive.cc2
-rw-r--r--source/blender/io/alembic/exporter/abc_writer_hair.cc2
-rw-r--r--source/blender/io/alembic/intern/abc_customdata.cc4
-rw-r--r--source/blender/io/alembic/intern/abc_reader_mesh.cc6
-rw-r--r--source/blender/io/avi/intern/avi.c14
-rw-r--r--source/blender/io/avi/intern/avi_mjpeg.c24
-rw-r--r--source/blender/io/avi/intern/avi_rgb.c25
-rw-r--r--source/blender/io/avi/intern/avi_rgb32.c14
-rw-r--r--source/blender/io/collada/AnimationExporter.cpp2
-rw-r--r--source/blender/io/collada/AnimationImporter.cpp62
-rw-r--r--source/blender/io/collada/ArmatureImporter.cpp8
-rw-r--r--source/blender/io/collada/DocumentImporter.cpp14
-rw-r--r--source/blender/io/collada/EffectExporter.cpp2
-rw-r--r--source/blender/io/collada/ExtraHandler.cpp4
-rw-r--r--source/blender/io/collada/GeometryExporter.cpp14
-rw-r--r--source/blender/io/collada/MeshImporter.cpp59
-rw-r--r--source/blender/io/collada/SkinInfo.cpp14
-rw-r--r--source/blender/io/collada/TransformReader.cpp2
-rw-r--r--source/blender/io/collada/collada_internal.cpp12
-rw-r--r--source/blender/io/collada/collada_utils.cpp2
-rw-r--r--source/blender/io/gpencil/intern/gpencil_io_import_svg.cc4
-rw-r--r--source/blender/io/usd/intern/usd_reader_mesh.cc6
-rw-r--r--source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc2
-rw-r--r--source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc2
24 files changed, 143 insertions, 157 deletions
diff --git a/source/blender/io/alembic/exporter/abc_archive.cc b/source/blender/io/alembic/exporter/abc_archive.cc
index 9c8a36958d5..c4a4f129ecf 100644
--- a/source/blender/io/alembic/exporter/abc_archive.cc
+++ b/source/blender/io/alembic/exporter/abc_archive.cc
@@ -136,7 +136,7 @@ static TimeSamplingPtr create_time_sampling(double scene_fps,
static void get_frames(double scene_fps,
const AlembicExportParams &params,
- unsigned int nr_of_samples,
+ uint nr_of_samples,
std::set<double> &r_frames)
{
/* Get one set of shutter samples, then add those around each frame to export. */
diff --git a/source/blender/io/alembic/exporter/abc_writer_hair.cc b/source/blender/io/alembic/exporter/abc_writer_hair.cc
index 4f09aee3ea9..f872943ad5c 100644
--- a/source/blender/io/alembic/exporter/abc_writer_hair.cc
+++ b/source/blender/io/alembic/exporter/abc_writer_hair.cc
@@ -190,7 +190,7 @@ void ABCHairWriter::write_hair_sample(const HierarchyContext &context,
for (int n = 0; n < mesh->totface; n++) {
MFace *face = &mface[n];
MTFace *tface = mtface + n;
- unsigned int vtx[4];
+ uint vtx[4];
vtx[0] = face->v1;
vtx[1] = face->v2;
vtx[2] = face->v3;
diff --git a/source/blender/io/alembic/intern/abc_customdata.cc b/source/blender/io/alembic/intern/abc_customdata.cc
index 5494bfaa6e8..3349f9fc30b 100644
--- a/source/blender/io/alembic/intern/abc_customdata.cc
+++ b/source/blender/io/alembic/intern/abc_customdata.cc
@@ -322,14 +322,14 @@ static void read_uvs(const CDStreamConfig &config,
MLoop *mloops = config.mloop;
MLoopUV *mloopuvs = static_cast<MLoopUV *>(data);
- unsigned int uv_index, loop_index, rev_loop_index;
+ uint uv_index, loop_index, rev_loop_index;
BLI_assert(uv_scope != ABC_UV_SCOPE_NONE);
const bool do_uvs_per_loop = (uv_scope == ABC_UV_SCOPE_LOOP);
for (int i = 0; i < config.totpoly; i++) {
MPoly &poly = mpolys[i];
- unsigned int rev_loop_offset = poly.loopstart + poly.totloop - 1;
+ uint rev_loop_offset = poly.loopstart + poly.totloop - 1;
for (int f = 0; f < poly.totloop; f++) {
rev_loop_index = rev_loop_offset - f;
diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc
index c9fa307541a..6ddf55109ab 100644
--- a/source/blender/io/alembic/intern/abc_reader_mesh.cc
+++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc
@@ -188,9 +188,9 @@ static void read_mpolys(CDStreamConfig &config, const AbcMeshData &mesh_data)
const bool do_uvs = (mloopuvs && uvs && uvs_indices);
const bool do_uvs_per_loop = do_uvs && mesh_data.uv_scope == ABC_UV_SCOPE_LOOP;
BLI_assert(!do_uvs || mesh_data.uv_scope != ABC_UV_SCOPE_NONE);
- unsigned int loop_index = 0;
- unsigned int rev_loop_index = 0;
- unsigned int uv_index = 0;
+ uint loop_index = 0;
+ uint rev_loop_index = 0;
+ uint uv_index = 0;
bool seen_invalid_geometry = false;
for (int i = 0; i < face_counts->size(); i++) {
diff --git a/source/blender/io/avi/intern/avi.c b/source/blender/io/avi/intern/avi.c
index 8bf4f8124a3..b4438bfb0a8 100644
--- a/source/blender/io/avi/intern/avi.c
+++ b/source/blender/io/avi/intern/avi.c
@@ -38,14 +38,14 @@ static char DEBUG_FCC[4];
(void)0
/* local functions */
-char *fcc_to_char(unsigned int fcc);
-char *tcc_to_char(unsigned int tcc);
+char *fcc_to_char(uint fcc);
+char *tcc_to_char(uint tcc);
/* implementation */
-unsigned int GET_FCC(FILE *fp)
+uint GET_FCC(FILE *fp)
{
- unsigned char tmp[4];
+ uchar tmp[4];
tmp[0] = getc(fp);
tmp[1] = getc(fp);
@@ -55,7 +55,7 @@ unsigned int GET_FCC(FILE *fp)
return FCC(tmp);
}
-unsigned int GET_TCC(FILE *fp)
+uint GET_TCC(FILE *fp)
{
char tmp[5];
@@ -67,7 +67,7 @@ unsigned int GET_TCC(FILE *fp)
return FCC(tmp);
}
-char *fcc_to_char(unsigned int fcc)
+char *fcc_to_char(uint fcc)
{
DEBUG_FCC[0] = (fcc)&127;
DEBUG_FCC[1] = (fcc >> 8) & 127;
@@ -77,7 +77,7 @@ char *fcc_to_char(unsigned int fcc)
return DEBUG_FCC;
}
-char *tcc_to_char(unsigned int tcc)
+char *tcc_to_char(uint tcc)
{
DEBUG_FCC[0] = (tcc)&127;
DEBUG_FCC[1] = (tcc >> 8) & 127;
diff --git a/source/blender/io/avi/intern/avi_mjpeg.c b/source/blender/io/avi/intern/avi_mjpeg.c
index fb42274fef2..16417fd12f7 100644
--- a/source/blender/io/avi/intern/avi_mjpeg.c
+++ b/source/blender/io/avi/intern/avi_mjpeg.c
@@ -22,10 +22,8 @@
#include "avi_mjpeg.h"
-static void jpegmemdestmgr_build(j_compress_ptr cinfo, unsigned char *buffer, size_t bufsize);
-static void jpegmemsrcmgr_build(j_decompress_ptr dinfo,
- const unsigned char *buffer,
- size_t bufsize);
+static void jpegmemdestmgr_build(j_compress_ptr cinfo, uchar *buffer, size_t bufsize);
+static void jpegmemsrcmgr_build(j_decompress_ptr dinfo, const uchar *buffer, size_t bufsize);
static size_t numbytes;
@@ -215,11 +213,7 @@ static void std_huff_tables(j_decompress_ptr dinfo)
sizeof(val_ac_chrominance));
}
-static int Decode_JPEG(unsigned char *inBuffer,
- unsigned char *outBuffer,
- unsigned int width,
- unsigned int height,
- size_t bufsize)
+static int Decode_JPEG(uchar *inBuffer, uchar *outBuffer, uint width, uint height, size_t bufsize)
{
struct jpeg_decompress_struct dinfo;
struct jpeg_error_mgr jerr;
@@ -272,16 +266,12 @@ static int Decode_JPEG(unsigned char *inBuffer,
return 1;
}
-static void Compress_JPEG(int quality,
- unsigned char *outbuffer,
- const unsigned char *inBuffer,
- int width,
- int height,
- size_t bufsize)
+static void Compress_JPEG(
+ int quality, uchar *outbuffer, const uchar *inBuffer, int width, int height, size_t bufsize)
{
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
- unsigned char marker[60];
+ uchar marker[60];
cinfo.err = jpeg_std_error(&jerr);
jpeg_create_compress(&cinfo);
@@ -339,7 +329,7 @@ static void Compress_JPEG(int quality,
jpeg_destroy_compress(&cinfo);
}
-static void interlace(unsigned char *to, unsigned char *from, int width, int height)
+static void interlace(uchar *to, uchar *from, int width, int height)
{
size_t i, rowstride = width * 3;
diff --git a/source/blender/io/avi/intern/avi_rgb.c b/source/blender/io/avi/intern/avi_rgb.c
index ffc3d0477fa..71022361df1 100644
--- a/source/blender/io/avi/intern/avi_rgb.c
+++ b/source/blender/io/avi/intern/avi_rgb.c
@@ -21,12 +21,9 @@
/* implementation */
-void *avi_converter_from_avi_rgb(AviMovie *movie,
- int stream,
- unsigned char *buffer,
- const size_t *size)
+void *avi_converter_from_avi_rgb(AviMovie *movie, int stream, uchar *buffer, const size_t *size)
{
- unsigned char *buf;
+ uchar *buf;
AviBitmapInfoHeader *bi;
short bits = 32;
@@ -38,24 +35,24 @@ void *avi_converter_from_avi_rgb(AviMovie *movie,
}
if (bits == 16) {
- unsigned short *pxl;
- unsigned char *to;
+ ushort *pxl;
+ uchar *to;
#ifdef __BIG_ENDIAN__
- unsigned char *pxla;
+ uchar *pxla;
#endif
buf = imb_alloc_pixels(
- movie->header->Height, movie->header->Width, 3, sizeof(unsigned char), "fromavirgbbuf");
+ movie->header->Height, movie->header->Width, 3, sizeof(uchar), "fromavirgbbuf");
if (buf) {
size_t y = movie->header->Height;
to = buf;
while (y--) {
- pxl = (unsigned short *)(buffer + y * movie->header->Width * 2);
+ pxl = (ushort *)(buffer + y * movie->header->Width * 2);
#ifdef __BIG_ENDIAN__
- pxla = (unsigned char *)pxl;
+ pxla = (uchar *)pxl;
#endif
size_t x = movie->header->Width;
@@ -82,7 +79,7 @@ void *avi_converter_from_avi_rgb(AviMovie *movie,
}
buf = imb_alloc_pixels(
- movie->header->Height, movie->header->Width, 3, sizeof(unsigned char), "fromavirgbbuf");
+ movie->header->Height, movie->header->Width, 3, sizeof(uchar), "fromavirgbbuf");
if (buf) {
size_t rowstride = movie->header->Width * 3;
@@ -110,9 +107,9 @@ void *avi_converter_from_avi_rgb(AviMovie *movie,
return buf;
}
-void *avi_converter_to_avi_rgb(AviMovie *movie, int stream, unsigned char *buffer, size_t *size)
+void *avi_converter_to_avi_rgb(AviMovie *movie, int stream, uchar *buffer, size_t *size)
{
- unsigned char *buf;
+ uchar *buf;
(void)stream; /* unused */
diff --git a/source/blender/io/avi/intern/avi_rgb32.c b/source/blender/io/avi/intern/avi_rgb32.c
index 84ae023fcdd..fcb83ffe47d 100644
--- a/source/blender/io/avi/intern/avi_rgb32.c
+++ b/source/blender/io/avi/intern/avi_rgb32.c
@@ -17,15 +17,15 @@
#include "AVI_avi.h"
#include "avi_rgb32.h"
-void *avi_converter_from_rgb32(AviMovie *movie, int stream, unsigned char *buffer, size_t *size)
+void *avi_converter_from_rgb32(AviMovie *movie, int stream, uchar *buffer, size_t *size)
{
- unsigned char *buf;
+ uchar *buf;
(void)stream; /* unused */
*size = (size_t)movie->header->Height * (size_t)movie->header->Width * 3;
buf = imb_alloc_pixels(
- movie->header->Height, movie->header->Width, 3, sizeof(unsigned char), "fromrgb32buf");
+ movie->header->Height, movie->header->Width, 3, sizeof(uchar), "fromrgb32buf");
if (!buf) {
return NULL;
}
@@ -46,16 +46,16 @@ void *avi_converter_from_rgb32(AviMovie *movie, int stream, unsigned char *buffe
return buf;
}
-void *avi_converter_to_rgb32(AviMovie *movie, int stream, unsigned char *buffer, size_t *size)
+void *avi_converter_to_rgb32(AviMovie *movie, int stream, uchar *buffer, size_t *size)
{
- unsigned char *buf;
- unsigned char *to, *from;
+ uchar *buf;
+ uchar *to, *from;
(void)stream; /* unused */
*size = (size_t)movie->header->Height * (size_t)movie->header->Width * 4;
buf = imb_alloc_pixels(
- movie->header->Height, movie->header->Width, 4, sizeof(unsigned char), "torgb32buf");
+ movie->header->Height, movie->header->Width, 4, sizeof(uchar), "torgb32buf");
if (!buf) {
return NULL;
}
diff --git a/source/blender/io/collada/AnimationExporter.cpp b/source/blender/io/collada/AnimationExporter.cpp
index 7df9df1f460..85e8ccf9f2a 100644
--- a/source/blender/io/collada/AnimationExporter.cpp
+++ b/source/blender/io/collada/AnimationExporter.cpp
@@ -687,7 +687,7 @@ std::string AnimationExporter::collada_interpolation_source(const BCAnimationCur
std::vector<float> frames;
curve.get_frames(frames);
- for (unsigned int i = 0; i < curve.sample_count(); i++) {
+ for (uint i = 0; i < curve.sample_count(); i++) {
float frame = frames[i];
int ipo = curve.get_interpolation_type(frame);
if (ipo == BEZT_IPO_BEZ) {
diff --git a/source/blender/io/collada/AnimationImporter.cpp b/source/blender/io/collada/AnimationImporter.cpp
index cc91c3eeac9..094f62e3c13 100644
--- a/source/blender/io/collada/AnimationImporter.cpp
+++ b/source/blender/io/collada/AnimationImporter.cpp
@@ -74,7 +74,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
float fps = (float)FPS;
size_t dim = curve->getOutDimension();
- unsigned int i;
+ uint i;
std::vector<FCurve *> &fcurves = curve_map[curve->getUniqueId()];
@@ -91,7 +91,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
fcu->array_index = 0;
fcu->auto_smoothing = U.auto_smoothing_new;
- for (unsigned int j = 0; j < curve->getKeyCount(); j++) {
+ for (uint j = 0; j < curve->getKeyCount(); j++) {
BezTriple bez;
memset(&bez, 0, sizeof(BezTriple));
@@ -106,7 +106,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
COLLADAFW::FloatOrDoubleArray &outtan = curve->getOutTangentValues();
/* In-tangent. */
- unsigned int index = 2 * (j * dim + i);
+ uint index = 2 * (j * dim + i);
bez.vec[0][0] = bc_get_float_value(intan, index) * fps;
bez.vec[0][1] = bc_get_float_value(intan, index + 1);
@@ -148,7 +148,7 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve)
void AnimationImporter::fcurve_deg_to_rad(FCurve *cu)
{
- for (unsigned int i = 0; i < cu->totvert; i++) {
+ for (uint i = 0; i < cu->totvert; i++) {
/* TODO: convert handles too. */
cu->bezt[i].vec[1][1] *= DEG2RADF(1.0f);
cu->bezt[i].vec[0][1] *= DEG2RADF(1.0f);
@@ -158,7 +158,7 @@ void AnimationImporter::fcurve_deg_to_rad(FCurve *cu)
void AnimationImporter::fcurve_scale(FCurve *cu, int scale)
{
- for (unsigned int i = 0; i < cu->totvert; i++) {
+ for (uint i = 0; i < cu->totvert; i++) {
/* TODO: convert handles too. */
cu->bezt[i].vec[1][1] *= scale;
cu->bezt[i].vec[0][1] *= scale;
@@ -484,7 +484,7 @@ void AnimationImporter::find_frames(std::vector<float> *frames, std::vector<FCur
for (iter = curves->begin(); iter != curves->end(); iter++) {
FCurve *fcu = *iter;
- for (unsigned int k = 0; k < fcu->totvert; k++) {
+ for (uint k = 0; k < fcu->totvert; k++) {
/* get frame value from bezTriple */
float fra = fcu->bezt[k].vec[1][0];
/* if frame already not added add frame to frames */
@@ -649,7 +649,7 @@ void AnimationImporter::Assign_color_animations(const COLLADAFW::UniqueId &listi
const COLLADAFW::AnimationList::AnimationBindings &bindings = animlist->getAnimationBindings();
/* all the curves belonging to the current binding */
std::vector<FCurve *> animcurves;
- for (unsigned int j = 0; j < bindings.getCount(); j++) {
+ for (uint j = 0; j < bindings.getCount(); j++) {
animcurves = curve_map[bindings[j].animation];
switch (bindings[j].animationClass) {
@@ -699,7 +699,7 @@ void AnimationImporter::Assign_float_animations(const COLLADAFW::UniqueId &listi
const COLLADAFW::AnimationList::AnimationBindings &bindings = animlist->getAnimationBindings();
/* all the curves belonging to the current binding */
std::vector<FCurve *> animcurves;
- for (unsigned int j = 0; j < bindings.getCount(); j++) {
+ for (uint j = 0; j < bindings.getCount(); j++) {
animcurves = curve_map[bindings[j].animation];
BLI_strncpy(rna_path, anim_type, sizeof(rna_path));
@@ -756,7 +756,7 @@ void AnimationImporter::Assign_lens_animations(const COLLADAFW::UniqueId &listid
const COLLADAFW::AnimationList::AnimationBindings &bindings = animlist->getAnimationBindings();
/* all the curves belonging to the current binding */
std::vector<FCurve *> animcurves;
- for (unsigned int j = 0; j < bindings.getCount(); j++) {
+ for (uint j = 0; j < bindings.getCount(); j++) {
animcurves = curve_map[bindings[j].animation];
BLI_strncpy(rna_path, anim_type, sizeof(rna_path));
@@ -767,7 +767,7 @@ void AnimationImporter::Assign_lens_animations(const COLLADAFW::UniqueId &listid
for (iter = animcurves.begin(); iter != animcurves.end(); iter++) {
FCurve *fcu = *iter;
- for (unsigned int i = 0; i < fcu->totvert; i++) {
+ for (uint i = 0; i < fcu->totvert; i++) {
fcu->bezt[i].vec[0][1] = convert_to_focal_length(
fcu->bezt[i].vec[0][1], fov_type, aspect, cam->sensor_x);
fcu->bezt[i].vec[1][1] = convert_to_focal_length(
@@ -817,7 +817,7 @@ void AnimationImporter::apply_matrix_curves(Object *ob,
}
/* new curves to assign matrix transform animation */
FCurve *newcu[10]; /* if tm_type is matrix, then create 10 curves: 4 rot, 3 loc, 3 scale */
- unsigned int totcu = 10;
+ uint totcu = 10;
const char *tm_str = nullptr;
char rna_path[200];
for (int i = 0; i < totcu; i++) {
@@ -1033,7 +1033,7 @@ void AnimationImporter::translate_Animations(
const COLLADAFW::TransformationPointerArray &nodeTransforms = node->getTransformations();
/* for each transformation in node */
- for (unsigned int i = 0; i < nodeTransforms.getCount(); i++) {
+ for (uint i = 0; i < nodeTransforms.getCount(); i++) {
COLLADAFW::Transformation *transform = nodeTransforms[i];
COLLADAFW::Transformation::TransformationType tm_type = transform->getTransformationType();
@@ -1053,7 +1053,7 @@ void AnimationImporter::translate_Animations(
animlist->getAnimationBindings();
/* all the curves belonging to the current binding */
std::vector<FCurve *> animcurves;
- for (unsigned int j = 0; j < bindings.getCount(); j++) {
+ for (uint j = 0; j < bindings.getCount(); j++) {
animcurves = curve_map[bindings[j].animation];
if (is_matrix) {
apply_matrix_curves(ob, animcurves, root, node, transform);
@@ -1092,7 +1092,7 @@ void AnimationImporter::translate_Animations(
ListBase *AnimCurves = &(act->curves);
const COLLADAFW::InstanceLightPointerArray &nodeLights = node->getInstanceLights();
- for (unsigned int i = 0; i < nodeLights.getCount(); i++) {
+ for (uint i = 0; i < nodeLights.getCount(); i++) {
const COLLADAFW::Light *light = (COLLADAFW::Light *)
FW_object_map[nodeLights[i]->getInstanciatedObjectId()];
@@ -1130,7 +1130,7 @@ void AnimationImporter::translate_Animations(
ListBase *AnimCurves = &(act->curves);
const COLLADAFW::InstanceCameraPointerArray &nodeCameras = node->getInstanceCameras();
- for (unsigned int i = 0; i < nodeCameras.getCount(); i++) {
+ for (uint i = 0; i < nodeCameras.getCount(); i++) {
const COLLADAFW::Camera *camera = (COLLADAFW::Camera *)
FW_object_map[nodeCameras[i]->getInstanciatedObjectId()];
@@ -1184,9 +1184,9 @@ void AnimationImporter::translate_Animations(
}
const COLLADAFW::InstanceGeometryPointerArray &nodeGeoms = node->getInstanceGeometries();
- for (unsigned int i = 0; i < nodeGeoms.getCount(); i++) {
+ for (uint i = 0; i < nodeGeoms.getCount(); i++) {
const COLLADAFW::MaterialBindingArray &matBinds = nodeGeoms[i]->getMaterialBindings();
- for (unsigned int j = 0; j < matBinds.getCount(); j++) {
+ for (uint j = 0; j < matBinds.getCount(); j++) {
const COLLADAFW::UniqueId &matuid = matBinds[j].getReferencedMaterial();
const COLLADAFW::Effect *ef = (COLLADAFW::Effect *)(FW_object_map[matuid]);
if (ef != nullptr) { /* can be NULL T28909. */
@@ -1273,7 +1273,7 @@ void AnimationImporter::add_bone_animation_sampled(Object *ob,
/* new curves to assign matrix transform animation */
FCurve *newcu[10]; /* if tm_type is matrix, then create 10 curves: 4 rot, 3 loc, 3 scale. */
- unsigned int totcu = 10;
+ uint totcu = 10;
const char *tm_str = nullptr;
char rna_path[200];
for (int i = 0; i < totcu; i++) {
@@ -1381,7 +1381,7 @@ AnimationImporter::AnimMix *AnimationImporter::get_animation_type(
const COLLADAFW::TransformationPointerArray &nodeTransforms = node->getTransformations();
/* for each transformation in node */
- for (unsigned int i = 0; i < nodeTransforms.getCount(); i++) {
+ for (uint i = 0; i < nodeTransforms.getCount(); i++) {
COLLADAFW::Transformation *transform = nodeTransforms[i];
const COLLADAFW::UniqueId &listid = transform->getAnimationList();
@@ -1395,7 +1395,7 @@ AnimationImporter::AnimMix *AnimationImporter::get_animation_type(
}
const COLLADAFW::InstanceLightPointerArray &nodeLights = node->getInstanceLights();
- for (unsigned int i = 0; i < nodeLights.getCount(); i++) {
+ for (uint i = 0; i < nodeLights.getCount(); i++) {
const COLLADAFW::Light *light = (COLLADAFW::Light *)
FW_object_map[nodeLights[i]->getInstanciatedObjectId()];
types->light = setAnimType(&(light->getColor()), (types->light), LIGHT_COLOR);
@@ -1408,7 +1408,7 @@ AnimationImporter::AnimMix *AnimationImporter::get_animation_type(
}
const COLLADAFW::InstanceCameraPointerArray &nodeCameras = node->getInstanceCameras();
- for (unsigned int i = 0; i < nodeCameras.getCount(); i++) {
+ for (uint i = 0; i < nodeCameras.getCount(); i++) {
const COLLADAFW::Camera *camera = (COLLADAFW::Camera *)
FW_object_map[nodeCameras[i]->getInstanciatedObjectId()];
if (camera == nullptr) {
@@ -1440,9 +1440,9 @@ AnimationImporter::AnimMix *AnimationImporter::get_animation_type(
}
const COLLADAFW::InstanceGeometryPointerArray &nodeGeoms = node->getInstanceGeometries();
- for (unsigned int i = 0; i < nodeGeoms.getCount(); i++) {
+ for (uint i = 0; i < nodeGeoms.getCount(); i++) {
const COLLADAFW::MaterialBindingArray &matBinds = nodeGeoms[i]->getMaterialBindings();
- for (unsigned int j = 0; j < matBinds.getCount(); j++) {
+ for (uint j = 0; j < matBinds.getCount(); j++) {
const COLLADAFW::UniqueId &matuid = matBinds[j].getReferencedMaterial();
const COLLADAFW::Effect *ef = (COLLADAFW::Effect *)(FW_object_map[matuid]);
if (ef != nullptr) { /* can be NULL T28909. */
@@ -1490,7 +1490,7 @@ void AnimationImporter::find_frames_old(std::vector<float> *frames,
/* for each <rotate>, <translate>, etc. there is a separate Transformation */
const COLLADAFW::TransformationPointerArray &nodeTransforms = node->getTransformations();
- unsigned int i;
+ uint i;
/* find frames at which to sample plus convert all rotation keys to radians */
for (i = 0; i < nodeTransforms.getCount(); i++) {
COLLADAFW::Transformation *transform = nodeTransforms[i];
@@ -1508,7 +1508,7 @@ void AnimationImporter::find_frames_old(std::vector<float> *frames,
if (bindings.getCount()) {
/* for each AnimationBinding get the fcurves which animate the transform */
- for (unsigned int j = 0; j < bindings.getCount(); j++) {
+ for (uint j = 0; j < bindings.getCount(); j++) {
std::vector<FCurve *> &curves = curve_map[bindings[j].animation];
bool xyz = ((nodeTmType == COLLADAFW::Transformation::TRANSLATE ||
nodeTmType == COLLADAFW::Transformation::SCALE) &&
@@ -1525,7 +1525,7 @@ void AnimationImporter::find_frames_old(std::vector<float> *frames,
fcurve_deg_to_rad(fcu);
}
- for (unsigned int k = 0; k < fcu->totvert; k++) {
+ for (uint k = 0; k < fcu->totvert; k++) {
/* get frame value from bezTriple */
float fra = fcu->bezt[k].vec[1][0];
/* if frame already not added add frame to frames */
@@ -1573,7 +1573,7 @@ Object *AnimationImporter::translate_animation_OLD(
find_frames_old(&frames, node, tm_type);
- unsigned int i;
+ uint i;
float irest_dae[4][4];
float rest[4][4], irest[4][4];
@@ -1632,7 +1632,7 @@ Object *AnimationImporter::translate_animation_OLD(
/* new curves */
FCurve *newcu[10]; /* if tm_type is matrix, then create 10 curves: 4 rot, 3 loc, 3 scale */
- unsigned int totcu = is_matrix ? 10 : (is_rotation ? 4 : 3);
+ uint totcu = is_matrix ? 10 : (is_rotation ? 4 : 3);
for (i = 0; i < totcu; i++) {
@@ -1825,7 +1825,7 @@ void AnimationImporter::evaluate_transform_at_frame(float mat[4][4],
unit_m4(mat);
- for (unsigned int i = 0; i < tms.getCount(); i++) {
+ for (uint i = 0; i < tms.getCount(); i++) {
COLLADAFW::Transformation *tm = tms[i];
COLLADAFW::Transformation::TransformationType type = tm->getTransformationType();
float m[4][4];
@@ -1909,7 +1909,7 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm,
dae_translate_to_v3(tm, vec);
}
- for (unsigned int index = 0; index < bindings.getCount(); index++) {
+ for (uint index = 0; index < bindings.getCount(); index++) {
const COLLADAFW::AnimationList::AnimationBinding &binding = bindings[index];
std::vector<FCurve *> &curves = curve_map[binding.animation];
COLLADAFW::AnimationList::AnimationClass animclass = binding.animationClass;
@@ -2062,7 +2062,7 @@ bool AnimationImporter::calc_joint_parent_mat_rest(float mat[4][4],
}
COLLADAFW::NodePointerArray &children = node->getChildNodes();
- for (unsigned int i = 0; i < children.getCount(); i++) {
+ for (uint i = 0; i < children.getCount(); i++) {
if (calc_joint_parent_mat_rest(mat, m, children[i], end)) {
return true;
}
diff --git a/source/blender/io/collada/ArmatureImporter.cpp b/source/blender/io/collada/ArmatureImporter.cpp
index c7db2356d20..a742ee3a1dd 100644
--- a/source/blender/io/collada/ArmatureImporter.cpp
+++ b/source/blender/io/collada/ArmatureImporter.cpp
@@ -190,7 +190,7 @@ int ArmatureImporter::create_bone(SkinInfo *skin,
COLLADAFW::NodePointerArray &children = node->getChildNodes();
- for (unsigned int i = 0; i < children.getCount(); i++) {
+ for (uint i = 0; i < children.getCount(); i++) {
int cl = create_bone(skin, children[i], bone, children.getCount(), mat, arm, layer_labels);
if (cl > chain_length) {
chain_length = cl;
@@ -719,7 +719,7 @@ void ArmatureImporter::set_pose(Object *ob_arm,
#endif
COLLADAFW::NodePointerArray &children = root_node->getChildNodes();
- for (unsigned int i = 0; i < children.getCount(); i++) {
+ for (uint i = 0; i < children.getCount(); i++) {
set_pose(ob_arm, children[i], bone_name, mat);
}
}
@@ -727,7 +727,7 @@ void ArmatureImporter::set_pose(Object *ob_arm,
bool ArmatureImporter::node_is_decomposed(const COLLADAFW::Node *node)
{
const COLLADAFW::TransformationPointerArray &nodeTransforms = node->getTransformations();
- for (unsigned int i = 0; i < nodeTransforms.getCount(); i++) {
+ for (uint i = 0; i < nodeTransforms.getCount(); i++) {
COLLADAFW::Transformation *transform = nodeTransforms[i];
COLLADAFW::Transformation::TransformationType tm_type = transform->getTransformationType();
if (tm_type == COLLADAFW::Transformation::MATRIX) {
@@ -879,7 +879,7 @@ bool ArmatureImporter::write_skin_controller_data(const COLLADAFW::SkinControlle
/* store join inv bind matrix to use it later in armature construction */
const COLLADAFW::Matrix4Array &inv_bind_mats = data->getInverseBindMatrices();
- for (unsigned int i = 0; i < data->getJointsCount(); i++) {
+ for (uint i = 0; i < data->getJointsCount(); i++) {
skin.add_joint(inv_bind_mats[i]);
}
diff --git a/source/blender/io/collada/DocumentImporter.cpp b/source/blender/io/collada/DocumentImporter.cpp
index 00c69a5fb8a..851e57bb750 100644
--- a/source/blender/io/collada/DocumentImporter.cpp
+++ b/source/blender/io/collada/DocumentImporter.cpp
@@ -213,7 +213,7 @@ void DocumentImporter::finish()
/* Write nodes to scene */
fprintf(stderr, "+-- Import Scene --------\n");
const COLLADAFW::NodePointerArray &roots = (*sit)->getRootNodes();
- for (unsigned int i = 0; i < roots.getCount(); i++) {
+ for (uint i = 0; i < roots.getCount(); i++) {
std::vector<Object *> *objects_done = write_node(roots[i], nullptr, sce, nullptr, false);
objects_to_scale->insert(
objects_to_scale->end(), objects_done->begin(), objects_done->end());
@@ -234,7 +234,7 @@ void DocumentImporter::finish()
for (const COLLADAFW::VisualScene *vscene : vscenes) {
const COLLADAFW::NodePointerArray &roots = vscene->getRootNodes();
- for (unsigned int i = 0; i < roots.getCount(); i++) {
+ for (uint i = 0; i < roots.getCount(); i++) {
translate_anim_recursive(roots[i], nullptr, nullptr);
}
}
@@ -292,7 +292,7 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node,
Object *ob;
#endif
- unsigned int i;
+ uint i;
if (node->getType() == COLLADAFW::Node::JOINT && par == nullptr) {
/* For Skeletons without root node we have to simulate the
@@ -424,7 +424,7 @@ Object *DocumentImporter::create_instance_node(Object *source_ob,
COLLADAFW::NodePointerArray &children = source_node->getChildNodes();
if (children.getCount()) {
- for (unsigned int i = 0; i < children.getCount(); i++) {
+ for (uint i = 0; i < children.getCount(); i++) {
COLLADAFW::Node *child_node = children[i];
const COLLADAFW::UniqueId &child_id = child_node->getUniqueId();
if (object_map.find(child_id) == object_map.end()) {
@@ -675,7 +675,7 @@ std::vector<Object *> *DocumentImporter::write_node(COLLADAFW::Node *node,
ob = *objects_done->begin();
}
- for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
+ for (uint i = 0; i < child_nodes.getCount(); i++) {
std::vector<Object *> *child_objects;
child_objects = write_node(child_nodes[i], node, sce, ob, is_library_node);
delete child_objects;
@@ -720,7 +720,7 @@ bool DocumentImporter::writeLibraryNodes(const COLLADAFW::LibraryNodes *libraryN
const COLLADAFW::NodePointerArray &nodes = libraryNodes->getNodes();
fprintf(stderr, "+-- Read Library nodes ----------\n");
- for (unsigned int i = 0; i < nodes.getCount(); i++) {
+ for (uint i = 0; i < nodes.getCount(); i++) {
std::vector<Object *> *child_objects;
child_objects = write_node(nodes[i], nullptr, sce, nullptr, true);
delete child_objects;
@@ -1182,7 +1182,7 @@ bool DocumentImporter::addExtraTags(const COLLADAFW::UniqueId &uid, ExtraTags *e
bool DocumentImporter::is_armature(COLLADAFW::Node *node)
{
COLLADAFW::NodePointerArray &child_nodes = node->getChildNodes();
- for (unsigned int i = 0; i < child_nodes.getCount(); i++) {
+ for (uint i = 0; i < child_nodes.getCount(); i++) {
if (child_nodes[i]->getType() == COLLADAFW::Node::JOINT) {
return true;
}
diff --git a/source/blender/io/collada/EffectExporter.cpp b/source/blender/io/collada/EffectExporter.cpp
index 40ce20617fc..e8a715633e1 100644
--- a/source/blender/io/collada/EffectExporter.cpp
+++ b/source/blender/io/collada/EffectExporter.cpp
@@ -217,7 +217,7 @@ void EffectsExporter::operator()(Material *ma, Object *ob)
create_image_samplers(ep, material_image_map, active_uv);
#if 0
- unsigned int a, b;
+ uint a, b;
for (a = 0, b = 0; a < tex_indices.size(); a++) {
MTex *t = ma->mtex[tex_indices[a]];
Image *ima = t->tex->ima;
diff --git a/source/blender/io/collada/ExtraHandler.cpp b/source/blender/io/collada/ExtraHandler.cpp
index b281f0e1a0a..d9c193ddbb5 100644
--- a/source/blender/io/collada/ExtraHandler.cpp
+++ b/source/blender/io/collada/ExtraHandler.cpp
@@ -43,7 +43,7 @@ bool ExtraHandler::textData(const char *text, size_t textLength)
}
bool ExtraHandler::parseElement(const char *profileName,
- const unsigned long &elementHash,
+ const ulong &elementHash,
const COLLADAFW::UniqueId &uniqueId)
{
/* implement for backwards compatibility, new version added object parameter */
@@ -51,7 +51,7 @@ bool ExtraHandler::parseElement(const char *profileName,
}
bool ExtraHandler::parseElement(const char *profileName,
- const unsigned long &elementHash,
+ const ulong &elementHash,
const COLLADAFW::UniqueId &uniqueId,
COLLADAFW::Object *object)
{
diff --git a/source/blender/io/collada/GeometryExporter.cpp b/source/blender/io/collada/GeometryExporter.cpp
index e60900ccdb6..0e74c3ed516 100644
--- a/source/blender/io/collada/GeometryExporter.cpp
+++ b/source/blender/io/collada/GeometryExporter.cpp
@@ -203,7 +203,7 @@ void GeometryExporter::createLooseEdgeList(Object *ob, Mesh *me, std::string &ge
const Span<MEdge> edges = me->edges();
int totedges = me->totedge;
int edges_in_linelist = 0;
- std::vector<unsigned int> edge_list;
+ std::vector<uint> edge_list;
int index;
/* Find all loose edges in Mesh
@@ -244,7 +244,7 @@ void GeometryExporter::createLooseEdgeList(Object *ob, Mesh *me, std::string &ge
static void prepareToAppendValues(bool is_triangulated,
COLLADASW::PrimitivesBase &primitive_list,
- std::vector<unsigned long> &vcount_list)
+ std::vector<ulong> &vcount_list)
{
/* performs the actual writing */
if (is_triangulated) {
@@ -285,7 +285,7 @@ static COLLADASW::PrimitivesBase *create_primitive_list(bool is_triangulated,
static bool collect_vertex_counts_per_poly(Mesh *me,
int material_index,
- std::vector<unsigned long> &vcount_list)
+ std::vector<ulong> &vcount_list)
{
const Span<MPoly> polys = me->polys();
const blender::bke::AttributeAccessor attributes = me->attributes();
@@ -325,7 +325,7 @@ void GeometryExporter::create_mesh_primitive_list(short material_index,
const Span<MPoly> polys = me->polys();
const Span<MLoop> loops = me->loops();
- std::vector<unsigned long> vcount_list;
+ std::vector<ulong> vcount_list;
bool is_triangulated = collect_vertex_counts_per_poly(me, material_index, vcount_list);
int polygon_count = vcount_list.size();
@@ -585,7 +585,7 @@ void GeometryExporter::createNormalsSource(std::string geom_id, Mesh *me, std::v
COLLADASW::FloatSourceF source(mSW);
source.setId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::NORMAL));
source.setArrayId(getIdBySemantics(geom_id, COLLADASW::InputSemantic::NORMAL) + ARRAY_ID_SUFFIX);
- source.setAccessorCount((unsigned long)nor.size());
+ source.setAccessorCount((ulong)nor.size());
source.setAccessorStride(3);
COLLADASW::SourceBase::ParameterNameList &param = source.getParameterNameList();
param.push_back("X");
@@ -612,7 +612,7 @@ void GeometryExporter::create_normals(std::vector<Normal> &normals,
std::vector<BCPolygonNormalsIndices> &polygons_normals,
Mesh *me)
{
- std::map<Normal, unsigned int> shared_normal_indices;
+ std::map<Normal, uint> shared_normal_indices;
int last_normal_index = -1;
const Span<MVert> verts = me->verts();
@@ -645,7 +645,7 @@ void GeometryExporter::create_normals(std::vector<Normal> &normals,
BCPolygonNormalsIndices poly_indices;
for (int loop_index = 0; loop_index < mpoly->totloop; loop_index++) {
- unsigned int loop_idx = mpoly->loopstart + loop_index;
+ uint loop_idx = mpoly->loopstart + loop_index;
if (use_vertex_normals) {
float normalized[3];
diff --git a/source/blender/io/collada/MeshImporter.cpp b/source/blender/io/collada/MeshImporter.cpp
index 4b7c4275568..fea57698261 100644
--- a/source/blender/io/collada/MeshImporter.cpp
+++ b/source/blender/io/collada/MeshImporter.cpp
@@ -208,7 +208,7 @@ MeshImporter::MeshImporter(UnitConverter *unitconv,
}
bool MeshImporter::set_poly_indices(
- MPoly *mpoly, MLoop *mloop, int loop_index, const unsigned int *indices, int loop_count)
+ MPoly *mpoly, MLoop *mloop, int loop_index, const uint *indices, int loop_count)
{
mpoly->loopstart = loop_index;
mpoly->totloop = loop_count;
@@ -276,7 +276,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)
const std::string &name = bc_get_dae_name(mesh);
- for (unsigned int i = 0; i < prim_arr.getCount(); i++) {
+ for (uint i = 0; i < prim_arr.getCount(); i++) {
COLLADAFW::MeshPrimitive *mp = prim_arr[i];
COLLADAFW::MeshPrimitive::PrimitiveType type = mp->getPrimitiveType();
@@ -292,7 +292,7 @@ bool MeshImporter::is_nice_mesh(COLLADAFW::Mesh *mesh)
int hole_count = 0;
int nonface_count = 0;
- for (unsigned int j = 0; j < vca.getCount(); j++) {
+ for (uint j = 0; j < vca.getCount(); j++) {
int count = vca[j];
if (abs(count) < 3) {
nonface_count++;
@@ -455,7 +455,7 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
CustomData_add_layer(&me->pdata, CD_MPOLY, CD_SET_DEFAULT, nullptr, me->totpoly);
CustomData_add_layer(&me->ldata, CD_MLOOP, CD_SET_DEFAULT, nullptr, me->totloop);
- unsigned int totuvset = collada_mesh->getUVCoords().getInputInfosArray().getCount();
+ uint totuvset = collada_mesh->getUVCoords().getInputInfosArray().getCount();
for (int i = 0; i < totuvset; i++) {
if (collada_mesh->getUVCoords().getLength(i) == 0) {
totuvset = 0;
@@ -490,7 +490,7 @@ void MeshImporter::allocate_poly_data(COLLADAFW::Mesh *collada_mesh, Mesh *me)
}
}
-unsigned int MeshImporter::get_vertex_count(COLLADAFW::Polygons *mp, int index)
+uint MeshImporter::get_vertex_count(COLLADAFW::Polygons *mp, int index)
{
int type = mp->getPrimitiveType();
int result;
@@ -513,7 +513,7 @@ unsigned int MeshImporter::get_vertex_count(COLLADAFW::Polygons *mp, int index)
return result;
}
-unsigned int MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh)
+uint MeshImporter::get_loose_edge_count(COLLADAFW::Mesh *mesh)
{
COLLADAFW::MeshPrimitiveArray &prim_arr = mesh->getMeshPrimitives();
int loose_edge_count = 0;
@@ -571,11 +571,11 @@ void MeshImporter::mesh_add_edges(Mesh *mesh, int len)
void MeshImporter::read_lines(COLLADAFW::Mesh *mesh, Mesh *me)
{
- unsigned int loose_edge_count = get_loose_edge_count(mesh);
+ uint loose_edge_count = get_loose_edge_count(mesh);
if (loose_edge_count > 0) {
- unsigned int face_edge_count = me->totedge;
- /* unsigned int total_edge_count = loose_edge_count + face_edge_count; */ /* UNUSED */
+ uint face_edge_count = me->totedge;
+ /* uint total_edge_count = loose_edge_count + face_edge_count; */ /* UNUSED */
mesh_add_edges(me, loose_edge_count);
MutableSpan<MEdge> edges = me->edges_for_write();
@@ -588,8 +588,8 @@ void MeshImporter::read_lines(COLLADAFW::Mesh *mesh, Mesh *me)
int type = mp->getPrimitiveType();
if (type == COLLADAFW::MeshPrimitive::LINES) {
- unsigned int edge_count = mp->getFaceCount();
- unsigned int *indices = mp->getPositionIndices().getData();
+ uint edge_count = mp->getFaceCount();
+ uint *indices = mp->getPositionIndices().getData();
for (int j = 0; j < edge_count; j++, med++) {
med->flag |= ME_LOOSEEDGE;
@@ -605,7 +605,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
Mesh *me,
blender::Vector<blender::float3> &loop_normals)
{
- unsigned int i;
+ uint i;
allocate_poly_data(collada_mesh, me);
@@ -632,8 +632,8 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
/* faces */
size_t prim_totpoly = mp->getFaceCount();
- unsigned int *position_indices = mp->getPositionIndices().getData();
- unsigned int *normal_indices = mp->getNormalIndices().getData();
+ uint *position_indices = mp->getPositionIndices().getData();
+ uint *normal_indices = mp->getNormalIndices().getData();
bool mp_has_normals = primitive_has_useable_normals(mp);
bool mp_has_faces = primitive_has_faces(mp);
@@ -649,22 +649,21 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
* XXX In particular the handling of the normal_indices is very wrong */
/* TODO: UV, vertex color and custom normal support */
if (collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLE_FANS) {
- unsigned int grouped_vertex_count = mp->getGroupedVertexElementsCount();
- for (unsigned int group_index = 0; group_index < grouped_vertex_count; group_index++) {
- unsigned int first_vertex = position_indices[0]; /* Store first trifan vertex */
- unsigned int first_normal = normal_indices[0]; /* Store first trifan vertex normal */
- unsigned int vertex_count = mp->getGroupedVerticesVertexCount(group_index);
+ uint grouped_vertex_count = mp->getGroupedVertexElementsCount();
+ for (uint group_index = 0; group_index < grouped_vertex_count; group_index++) {
+ uint first_vertex = position_indices[0]; /* Store first trifan vertex */
+ uint first_normal = normal_indices[0]; /* Store first trifan vertex normal */
+ uint vertex_count = mp->getGroupedVerticesVertexCount(group_index);
- for (unsigned int vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {
+ for (uint vertex_index = 0; vertex_index < vertex_count - 2; vertex_index++) {
/* For each triangle store indices of its 3 vertices */
- unsigned int triangle_vertex_indices[3] = {
+ uint triangle_vertex_indices[3] = {
first_vertex, position_indices[1], position_indices[2]};
set_poly_indices(mpoly, mloop, loop_index, triangle_vertex_indices, 3);
if (mp_has_normals) { /* vertex normals, same implementation as for the triangles */
/* The same for vertices normals. */
- unsigned int vertex_normal_indices[3] = {
- first_normal, normal_indices[1], normal_indices[2]};
+ uint vertex_normal_indices[3] = {first_normal, normal_indices[1], normal_indices[2]};
if (!is_flat_face(vertex_normal_indices, nor, 3)) {
mpoly->flag |= ME_SMOOTH;
}
@@ -693,13 +692,13 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
collada_meshtype == COLLADAFW::MeshPrimitive::POLYGONS ||
collada_meshtype == COLLADAFW::MeshPrimitive::TRIANGLES) {
COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp;
- unsigned int start_index = 0;
+ uint start_index = 0;
COLLADAFW::IndexListArray &index_list_array_uvcoord = mp->getUVCoordIndicesArray();
COLLADAFW::IndexListArray &index_list_array_vcolor = mp->getColorIndicesArray();
int invalid_loop_holes = 0;
- for (unsigned int j = 0; j < prim_totpoly; j++) {
+ for (uint j = 0; j < prim_totpoly; j++) {
/* Vertices in polygon: */
int vcount = get_vertex_count(mpvc, j);
@@ -712,7 +711,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
invalid_loop_holes += 1;
}
- for (unsigned int uvset_index = 0; uvset_index < index_list_array_uvcoord.getCount();
+ for (uint uvset_index = 0; uvset_index < index_list_array_uvcoord.getCount();
uvset_index++) {
/* get mtface by face index and uv set index */
COLLADAFW::IndexList &index_list = *index_list_array_uvcoord[uvset_index];
@@ -743,7 +742,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
if (use_custom_normals) {
/* Store the custom normals for later application. */
float vert_normal[3];
- unsigned int *cur_normal = normal_indices;
+ uint *cur_normal = normal_indices;
for (int k = 0; k < vcount; k++, cur_normal++) {
get_vector(vert_normal, nor, *cur_normal, 3);
normalize_v3(vert_normal);
@@ -755,7 +754,7 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh,
if (mp->hasColorIndices()) {
int vcolor_count = index_list_array_vcolor.getCount();
- for (unsigned int vcolor_index = 0; vcolor_index < vcolor_count; vcolor_index++) {
+ for (uint vcolor_index = 0; vcolor_index < vcolor_count; vcolor_index++) {
COLLADAFW::IndexList &color_index_list = *mp->getColorIndices(vcolor_index);
COLLADAFW::String colname = extract_vcolname(color_index_list.getName());
@@ -847,7 +846,7 @@ void MeshImporter::get_vector(float v[3], COLLADAFW::MeshVertexData &arr, int i,
}
}
-bool MeshImporter::is_flat_face(unsigned int *nind, COLLADAFW::MeshVertexData &nor, int count)
+bool MeshImporter::is_flat_face(uint *nind, COLLADAFW::MeshVertexData &nor, int count)
{
float a[3], b[3];
@@ -1107,7 +1106,7 @@ Object *MeshImporter::create_mesh_object(
COLLADAFW::MaterialBindingArray &mat_array = geom->getMaterialBindings();
/* loop through geom's materials */
- for (unsigned int i = 0; i < mat_array.getCount(); i++) {
+ for (uint i = 0; i < mat_array.getCount(); i++) {
if (mat_array[i].getReferencedMaterial().isValid()) {
assign_material_to_geom(mat_array[i], uid_material_map, ob, geom_uid, i);
diff --git a/source/blender/io/collada/SkinInfo.cpp b/source/blender/io/collada/SkinInfo.cpp
index 8144e0a499d..0654bae3730 100644
--- a/source/blender/io/collada/SkinInfo.cpp
+++ b/source/blender/io/collada/SkinInfo.cpp
@@ -77,7 +77,7 @@ void SkinInfo::transfer_int_array_data_const(const COLLADAFW::IntValuesArray &sr
void SkinInfo::transfer_uint_array_data_const(const COLLADAFW::UIntValuesArray &src,
COLLADAFW::UIntValuesArray &dest)
{
- dest.setData((unsigned int *)src.getData(), src.getCount());
+ dest.setData((uint *)src.getData(), src.getCount());
dest.yieldOwnerShip();
}
@@ -90,7 +90,7 @@ void SkinInfo::borrow_skin_controller_data(const COLLADAFW::SkinControllerData *
/* cannot transfer data for FloatOrDoubleArray, copy values manually */
const COLLADAFW::FloatOrDoubleArray &weight = skin->getWeights();
- for (unsigned int i = 0; i < weight.getValuesCount(); i++) {
+ for (uint i = 0; i < weight.getValuesCount(); i++) {
weights.push_back(bc_get_float_value(weight, i));
}
@@ -118,7 +118,7 @@ void SkinInfo::set_controller(const COLLADAFW::SkinController *co)
/* fill in joint UIDs */
const COLLADAFW::UniqueIdArray &joint_uids = co->getJoints();
- for (unsigned int i = 0; i < joint_uids.getCount(); i++) {
+ for (uint i = 0; i < joint_uids.getCount(); i++) {
joint_data[i].joint_uid = joint_uids[i];
/* store armature pointer */
@@ -181,7 +181,7 @@ bool SkinInfo::uses_joint_or_descendant(COLLADAFW::Node *node)
}
COLLADAFW::NodePointerArray &children = node->getChildNodes();
- for (unsigned int i = 0; i < children.getCount(); i++) {
+ for (uint i = 0; i < children.getCount(); i++) {
if (uses_joint_or_descendant(children[i])) {
return true;
}
@@ -254,9 +254,9 @@ void SkinInfo::link_armature(bContext *C,
*
* get def group by index with BLI_findlink */
- for (unsigned int vertex = 0, weight = 0; vertex < joints_per_vertex.getCount(); vertex++) {
+ for (uint vertex = 0, weight = 0; vertex < joints_per_vertex.getCount(); vertex++) {
- unsigned int limit = weight + joints_per_vertex[vertex];
+ uint limit = weight + joints_per_vertex[vertex];
for (; weight < limit; weight++) {
int joint = joint_indices[weight], joint_weight = weight_indices[weight];
@@ -319,7 +319,7 @@ bool SkinInfo::find_node_in_tree(COLLADAFW::Node *node, COLLADAFW::Node *tree_ro
}
COLLADAFW::NodePointerArray &children = tree_root->getChildNodes();
- for (unsigned int i = 0; i < children.getCount(); i++) {
+ for (uint i = 0; i < children.getCount(); i++) {
if (find_node_in_tree(node, children[i])) {
return true;
}
diff --git a/source/blender/io/collada/TransformReader.cpp b/source/blender/io/collada/TransformReader.cpp
index e5872c28bce..47deddb5feb 100644
--- a/source/blender/io/collada/TransformReader.cpp
+++ b/source/blender/io/collada/TransformReader.cpp
@@ -33,7 +33,7 @@ void TransformReader::get_node_mat(float mat[4][4],
unit_m4(mat);
- for (unsigned int i = 0; i < node->getTransformations().getCount(); i++) {
+ for (uint i = 0; i < node->getTransformations().getCount(); i++) {
COLLADAFW::Transformation *tm = node->getTransformations()[i];
COLLADAFW::Transformation::TransformationType type = tm->getTransformationType();
diff --git a/source/blender/io/collada/collada_internal.cpp b/source/blender/io/collada/collada_internal.cpp
index da9a4cd4a9b..c4f13f1cbd2 100644
--- a/source/blender/io/collada/collada_internal.cpp
+++ b/source/blender/io/collada/collada_internal.cpp
@@ -153,7 +153,7 @@ void UnitConverter::calculate_scale(Scene &sce)
* The COLLADA spec also allows additional chars for member access ('.'), these
* must obviously be removed too, otherwise they would be heavily misinterpreted.
*/
-const unsigned char translate_start_name_map[256] = {
+const uchar translate_start_name_map[256] = {
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
@@ -172,7 +172,7 @@ const unsigned char translate_start_name_map[256] = {
242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255,
};
-const unsigned char translate_name_map[256] = {
+const uchar translate_name_map[256] = {
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 95,
@@ -212,16 +212,16 @@ std::string translate_id(const std::string &id)
}
std::string id_translated = id;
- id_translated[0] = translate_start_name_map[(unsigned int)id_translated[0]];
- for (unsigned int i = 1; i < id_translated.size(); i++) {
- id_translated[i] = translate_name_map[(unsigned int)id_translated[i]];
+ id_translated[0] = translate_start_name_map[(uint)id_translated[0]];
+ for (uint i = 1; i < id_translated.size(); i++) {
+ id_translated[i] = translate_name_map[(uint)id_translated[i]];
}
/* It's so much workload now, the if () should speed up things. */
if (id_translated != id) {
/* Search duplicates. */
map_string_list::iterator iter = global_id_map.find(id_translated);
if (iter != global_id_map.end()) {
- unsigned int i = 0;
+ uint i = 0;
bool found = false;
for (i = 0; i < iter->second.size(); i++) {
if (id == iter->second[i]) {
diff --git a/source/blender/io/collada/collada_utils.cpp b/source/blender/io/collada/collada_utils.cpp
index 03bc14c6d13..bfa150faf8b 100644
--- a/source/blender/io/collada/collada_utils.cpp
+++ b/source/blender/io/collada/collada_utils.cpp
@@ -66,7 +66,7 @@
#include "ExportSettings.h"
#include "collada_utils.h"
-float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray &array, unsigned int index)
+float bc_get_float_value(const COLLADAFW::FloatOrDoubleArray &array, uint index)
{
if (index >= array.getValuesCount()) {
return 0.0f;
diff --git a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
index 06460a1beba..ebad236bada 100644
--- a/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
+++ b/source/blender/io/gpencil/intern/gpencil_io_import_svg.cc
@@ -212,9 +212,9 @@ void GpencilImporterSVG::create_stroke(bGPdata *gpd,
}
/* Unpack internal NanoSVG color. */
-static void unpack_nano_color(const unsigned int pack, float r_col[4])
+static void unpack_nano_color(const uint pack, float r_col[4])
{
- unsigned char rgb_u[4];
+ uchar rgb_u[4];
rgb_u[0] = ((pack) >> 0) & 0xFF;
rgb_u[1] = ((pack) >> 8) & 0xFF;
diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc
index 7cb4c65f166..e76b9d3283b 100644
--- a/source/blender/io/usd/intern/usd_reader_mesh.cc
+++ b/source/blender/io/usd/intern/usd_reader_mesh.cc
@@ -342,9 +342,9 @@ void USDMeshReader::read_mpolys(Mesh *mesh)
void USDMeshReader::read_uvs(Mesh *mesh, const double motionSampleTime, const bool load_uvs)
{
- unsigned int loop_index = 0;
- unsigned int rev_loop_index = 0;
- unsigned int uv_index = 0;
+ uint loop_index = 0;
+ uint rev_loop_index = 0;
+ uint uv_index = 0;
const CustomData *ldata = &mesh->ldata;
diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc
index f8c7da75a70..851358f8762 100644
--- a/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc
+++ b/source/blender/io/wavefront_obj/exporter/obj_export_mtl.cc
@@ -153,7 +153,7 @@ static std::string get_image_filepath(const bNode *tex_node)
if (tex_image->source == IMA_SRC_SEQUENCE) {
char head[FILE_MAX], tail[FILE_MAX];
- unsigned short numlen;
+ ushort numlen;
int framenr = static_cast<NodeTexImage *>(tex_node->storage)->iuser.framenr;
BLI_path_sequence_decode(path, head, tail, &numlen);
BLI_path_sequence_encode(path, head, tail, numlen, framenr);
diff --git a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
index efa6473b494..56fe81181e3 100644
--- a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
+++ b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc
@@ -106,7 +106,7 @@ static void geom_add_mrgb_colors(const char *p, const char *end, GlobalVertices
if (ELEM(res.ec, std::errc::invalid_argument, std::errc::result_out_of_range)) {
return;
}
- unsigned char srgb[4];
+ uchar srgb[4];
srgb[0] = (value >> 16) & 0xFF;
srgb[1] = (value >> 8) & 0xFF;
srgb[2] = value & 0xFF;