Skip to content
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

examples: simple_buffer: We must explicit convert pointer after mallo… #1026

Merged
merged 1 commit into from Sep 4, 2021

Conversation

kmou424
Copy link
Contributor

@kmou424 kmou424 commented Sep 4, 2021

…c in c++

Aim: To adapt C++

Compilation errors:
simple_buffer.c:47:9: error: cannot initialize a variable of type 'char *' with an rvalue of type 'void '
char
compressed_data = malloc((size_t)max_dst_size);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simple_buffer.c:76:15: error: cannot initialize a variable of type 'char *const' with an rvalue of type 'void '
char
const regen_buffer = malloc(src_size);
^ ~~~~~~~~~~~~~~~~
2 errors generated.

Generally, we need code that can be used in C and C++.I think this change will bring a better experience for visitors.

If this is unnecessary, please close this PR :)

…c in c++

Aim: To adapt C++

Compilation errors:
simple_buffer.c:47:9: error: cannot initialize a variable of type 'char *' with an rvalue of type 'void *'
  char* compressed_data = malloc((size_t)max_dst_size);
        ^                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
simple_buffer.c:76:15: error: cannot initialize a variable of type 'char *const' with an rvalue of type 'void *'
  char* const regen_buffer = malloc(src_size);
              ^              ~~~~~~~~~~~~~~~~
2 errors generated.
@Cyan4973 Cyan4973 merged commit d233473 into lz4:dev Sep 4, 2021
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.

None yet

2 participants