Skip to content

Bugfixed Visual Studio errors when compiled as C++ sources #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 26, 2015
Merged

Bugfixed Visual Studio errors when compiled as C++ sources #4

merged 1 commit into from
Jan 26, 2015

Conversation

r-lyeh-archived
Copy link
Contributor

Hello Yann,

Here you have a few missing casts.
They're not required in C, but library will fail to compile in C++ mode otherwise
(reproduce it by typìng cl.exe /Tp fse.c and cl.exe /Tp zstd.c)

Great library.
Keep up the good work.

  • r-lyeh

PS: I have kept your identation style when creating the type casts. Also, see errors bugfixed below:

fse.c(135) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(148) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(169) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(183) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(621) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const rank_t *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(622) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const rank_t *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(1008) : error C2440: 'initializing' : cannot convert from 'void *' to 'U32 *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(1026) : error C2440: 'initializing' : cannot convert from 'void *' to 'U32 *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(1145) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const U32 *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
fse.c(1514) : error C2440: 'initializing' : cannot convert from 'void *' to 'U32 *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast

zstd.c(205) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(206) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(213) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(230) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(279) : error C2440: 'initializing' : cannot convert from 'ZSTD_cctx_t' to 'refTables_t *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(440) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(461) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(954) : error C2664: 'size_t ZSTD_compressEntropy(BYTE *,size_t,const BYTE *,const BYTE *,const BYTE *,const BYTE *,const BYTE *,const U32 *,const BYTE *,const BYTE *,size_t,size_t)' : cannot convert argument 1 from 'void *' to 'BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1001) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1003) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1009) : error C2440: '=' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1013) : error C2440: '=' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1068) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1085) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1133) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1142) : error C2440: '=' : cannot convert from 'int' to 'blockType_t' Conversion to enumeration type requires an explicit cast (static_cast, C-style cast or function-style cast)
zstd.c(1233) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1261) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1263) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1303) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1397) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1399) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1561) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1563) : error C2440: 'initializing' : cannot convert from 'void *' to 'BYTE *const ' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1640) : error C2440: 'initializing' : cannot convert from 'void *' to 'dctx_t *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast
zstd.c(1698) : error C2440: 'initializing' : cannot convert from 'const void *' to 'const BYTE *' Conversion from 'void*' to pointer to non-'void' requires an explicit cast

Cyan4973 added a commit that referenced this pull request Jan 26, 2015
Bugfixed Visual Studio errors when compiled as C++ sources
@Cyan4973 Cyan4973 merged commit f10532a into facebook:dev Jan 26, 2015
@Cyan4973
Copy link
Contributor

Thanks, it's a straightforward and very useful patch for C++

@r-lyeh-archived
Copy link
Contributor Author

👍 🍺

@r-lyeh-archived r-lyeh-archived deleted the dev branch January 26, 2015 10:25
Cyan4973 pushed a commit that referenced this pull request Jun 28, 2017
pull from facebook/zstd
GeorgeLu97 added a commit to GeorgeLu97/zstd that referenced this pull request Jun 8, 2018
# This is the 1st commit message:

Make paramgrill use bench.c benchmarking

# This is the commit message facebook#2:

Minor changes

# This is the commit message facebook#3:

Explicit casting

# This is the commit message facebook#4:

Makefile fix

# This is the commit message facebook#5:

casting, type fix
Cyan4973 pushed a commit that referenced this pull request Jun 19, 2019
Cyan4973 pushed a commit that referenced this pull request Oct 24, 2019
francescosalani pushed a commit to francescosalani/zstd that referenced this pull request Apr 3, 2025
…acebook#4)

* Update audiocore to pull a version from S3 to use in build process

* Added instruction to push and pull files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants