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

Fix ambiguous overloaded call on SPK::IO::Buffer #20

Open
wants to merge 1 commit into
base: spark2
Choose a base branch
from

Conversation

kingscallop
Copy link
Contributor

When trying to write a 'size_t' to a SPK::IO::Buffer, the following error happens.

spark/include/Core/IO/SPK_IO_Buffer.h:224:27: error: call of overloaded ‘put(long unsigned int&)’ is ambiguous
  224 |                 buffer.put(value);
      |                 ~~~~~~~~~~^~~~~~~
spark/include/Core/IO/SPK_IO_Buffer.h:76:22: note: candidate: ‘void SPK::IO::Buffer::put(char)’
   76 |                 void put(char c);
      |                      ^~~
spark/include/Core/IO/SPK_IO_Buffer.h:96:22: note: candidate: ‘void SPK::IO::Buffer::put(unsigned char)’
   96 |                 void put(unsigned char c)       { put((char)c); }
      |                      ^~~
spark/include/Core/IO/SPK_IO_Buffer.h:97:22: note: candidate: ‘void SPK::IO::Buffer::put(signed char)’
   97 |                 void put(signed char c)         { put((char)c); }


etc.

As there is no overload to 'size_t', the patch casts it to unsigned int.

When trying to write a 'size_t' to a SPK::IO::Buffer, the following error happens.

spark/include/Core/IO/SPK_IO_Buffer.h:224:27: error: call of overloaded ‘put(long unsigned int&)’ is ambiguous
  224 |                 buffer.put(value);
      |                 ~~~~~~~~~~^~~~~~~
spark/include/Core/IO/SPK_IO_Buffer.h:76:22: note: candidate: ‘void SPK::IO::Buffer::put(char)’
   76 |                 void put(char c);
      |                      ^~~
spark/include/Core/IO/SPK_IO_Buffer.h:96:22: note: candidate: ‘void SPK::IO::Buffer::put(unsigned char)’
   96 |                 void put(unsigned char c)       { put((char)c); }
      |                      ^~~
spark/include/Core/IO/SPK_IO_Buffer.h:97:22: note: candidate: ‘void SPK::IO::Buffer::put(signed char)’
   97 |                 void put(signed char c)         { put((char)c); }

etc.

As there is no overload to 'size_t', the patch casts it to unsigned int.
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.

1 participant