diff options
author | Ray Molenkamp <github@lazydodo.com> | 2020-03-18 21:13:03 +0300 |
---|---|---|
committer | Ray Molenkamp <github@lazydodo.com> | 2020-03-18 21:13:03 +0300 |
commit | 9a116c7c2d957e0e10a926eccc38dcb28cfec6e4 (patch) | |
tree | 620a9efd22d96e6fce9ec8cf8f1c6c0c2996b687 /source/blender/modifiers/intern | |
parent | ac74a843d2775c834454ede9e3161e574f5b2e7c (diff) |
Cleanup: 64 bit file IO on windows.
Unlike Linux where fseek/tell will be either 32 or 64 bit
depending on the target platform, it will always be 32 bit
on windows.
We had some macro magic in BLI_winstuff.h that substituted
them for 64 bit versions, but that is upsetting the system
headers if they get included after BLI_winstuff.h which
is problematic for D6811.
This diff adds proper functions in blenlib and updates
all calls that were using the BLI_winstuff.h header to
gain 64 bit file IO.
note: Anything that was using the 32 bit versions (ie not
including BLI_winstuff.h) will still be using the 32 bit
versions, which is perhaps a good code quality Friday project.
Differential Revision: https://developer.blender.org/D7160
Reviewers: brecht dfelinto
Diffstat (limited to 'source/blender/modifiers/intern')
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshcache_mdd.c | 10 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshcache_pc2.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshcache_mdd.c b/source/blender/modifiers/intern/MOD_meshcache_mdd.c index a3ab0120ff9..f3cb1469d8b 100644 --- a/source/blender/modifiers/intern/MOD_meshcache_mdd.c +++ b/source/blender/modifiers/intern/MOD_meshcache_mdd.c @@ -155,12 +155,12 @@ bool MOD_meshcache_read_mdd_index(FILE *fp, return false; } - if (fseek(fp, mdd_head.frame_tot * sizeof(int), SEEK_CUR) != 0) { + if (BLI_fseek(fp, mdd_head.frame_tot * sizeof(int), SEEK_CUR) != 0) { *err_str = "Header seek failed"; return false; } - if (fseek(fp, sizeof(float) * 3 * index * mdd_head.verts_tot, SEEK_CUR) != 0) { + if (BLI_fseek(fp, sizeof(float) * 3 * index * mdd_head.verts_tot, SEEK_CUR) != 0) { *err_str = "Failed to seek frame"; return false; } @@ -234,7 +234,7 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp, if (index_range[0] == index_range[1]) { /* read single */ - if ((fseek(fp, 0, SEEK_SET) == 0) && + if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str)) { return true; } @@ -244,9 +244,9 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp, } else { /* read both and interpolate */ - if ((fseek(fp, 0, SEEK_SET) == 0) && + if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) && - (fseek(fp, 0, SEEK_SET) == 0) && + (BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str)) { return true; } diff --git a/source/blender/modifiers/intern/MOD_meshcache_pc2.c b/source/blender/modifiers/intern/MOD_meshcache_pc2.c index 7b8ad0bd705..8d4b4a6dfdd 100644 --- a/source/blender/modifiers/intern/MOD_meshcache_pc2.c +++ b/source/blender/modifiers/intern/MOD_meshcache_pc2.c @@ -146,7 +146,7 @@ bool MOD_meshcache_read_pc2_index(FILE *fp, return false; } - if (fseek(fp, sizeof(float) * 3 * index * pc2_head.verts_tot, SEEK_CUR) != 0) { + if (BLI_fseek(fp, sizeof(float) * 3 * index * pc2_head.verts_tot, SEEK_CUR) != 0) { *err_str = "Failed to seek frame"; return false; } @@ -209,7 +209,7 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp, if (index_range[0] == index_range[1]) { /* read single */ - if ((fseek(fp, 0, SEEK_SET) == 0) && + if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str)) { return true; } @@ -219,9 +219,9 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp, } else { /* read both and interpolate */ - if ((fseek(fp, 0, SEEK_SET) == 0) && + if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) && - (fseek(fp, 0, SEEK_SET) == 0) && + (BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str)) { return true; } |