Skip to content

Commit

Permalink
static cast with proper function signature, BIOS::LCD::BufferWrite
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzegorz Rajtar authored and Grzegorz Rajtar committed Aug 9, 2023
1 parent f69c6fe commit da455c4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion system/apps/79_cc1101osc/source/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ namespace RPC
if (strcmp(command, "LCD::BufferBegin")==0)
return (uint32_t)static_cast<void(*)(CRect const&)>(BIOS::LCD::BufferBegin);
if (strcmp(command, "LCD::BufferWrite")==0)
return (uint32_t)static_cast<void(*)(unsigned short*, int)>(BIOS::LCD::BufferWrite);
return (uint32_t)static_cast<void(*)(const unsigned short*, int)>(BIOS::LCD::BufferWrite);
if (strcmp(command, "LCD::Background")==0)
return (uint32_t)static_cast<void(*)(CRect const&, uint32_t, uint32_t)>(GUI::Background);
if (strcmp(command, "LCD::Bar")==0)
Expand Down
2 changes: 1 addition & 1 deletion system/apps/test70_webusb/source/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace RPC
if (strcmp(command, "LCD::BufferBegin")==0)
return (uint32_t)static_cast<void(*)(CRect const&)>(BIOS::LCD::BufferBegin);
if (strcmp(command, "LCD::BufferWrite")==0)
return (uint32_t)static_cast<void(*)(unsigned short*, int)>(BIOS::LCD::BufferWrite);
return (uint32_t)static_cast<void(*)(const unsigned short*, int)>(BIOS::LCD::BufferWrite);
if (strcmp(command, "LCD::Background")==0)
return (uint32_t)static_cast<void(*)(CRect const&, uint32_t, uint32_t)>(GUI::Background);
if (strcmp(command, "LCD::Bar")==0)
Expand Down
2 changes: 1 addition & 1 deletion system/apps_experiments/test68_webusb/source/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ SPI::write(p, 32);
if (strcmp(command, "LCD::BufferBegin")==0)
return (uint32_t)(uint32_t)static_cast<void(*)(CRect const&)>(BIOS::LCD::BufferBegin);
if (strcmp(command, "LCD::BufferWrite")==0)
return (uint32_t)static_cast<void(*)(unsigned short*, int)>(BIOS::LCD::BufferWrite);
return (uint32_t)static_cast<void(*)(const unsigned short*, int)>(BIOS::LCD::BufferWrite);

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion system/apps_featured/117_gabuino/source/rpc.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace RPC
if (strcmp(command, "LCD::BufferBegin")==0)
return (uint32_t)static_cast<void(*)(CRect const&)>(BIOS::LCD::BufferBegin);
if (strcmp(command, "LCD::BufferWrite")==0)
return (uint32_t)static_cast<void(*)(unsigned short*, int)>(BIOS::LCD::BufferWrite);
return (uint32_t)static_cast<void(*)(const unsigned short*, int)>(BIOS::LCD::BufferWrite);
if (strcmp(command, "LCD::Background")==0)
return (uint32_t)static_cast<void(*)(CRect const&, uint32_t, uint32_t)>(GUI::Background);
if (strcmp(command, "LCD::Bar")==0)
Expand Down
8 changes: 8 additions & 0 deletions system/os_host/source/framework/BufferedIo.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,14 @@ class CBufferedWriter : public CSerialize
*this << CStream(dwData);
return *this;
}

virtual CBufferedWriter& operator <<( char c )
{
char buf[2];
buf[0] = c; buf[1] = 0;
*this << CStream(buf);
return *this;
}

virtual CBufferedWriter& operator <<( const CStream& stream_ )
{
Expand Down

0 comments on commit da455c4

Please sign in to comment.