Jyers / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. | Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
http://marlinfw.org
GNU General Public License v3.0
2.14k stars 387 forks source link

[BUG] Fix warnings and still allow configured preheat labels #23

Closed Spirko closed 3 years ago

Spirko commented 3 years ago

In the ExtensibleUI branch, Marlin/src/lcd/extui/lib/creality_dwin/creality_dwin.cpp, function CrealityDWINClass::Get_Menu_Title(), I was getting warnings about using strcat(). Since these string constants, they can be concatenated by juxtaposition. Example:

case Preheat1:
  return (char*)(PREHEAT_1_LABEL " Settings");
Jyers commented 3 years ago

Wow! I had fixed that issue by removing the settings bit all together but that is a much better solution! I've been programming in C++ a long time so I love it when I get to learn something new!

Spirko commented 3 years ago

That screen makes sense with just PREHEAT_1_LABEL, so your solution works, too.

Jyers commented 3 years ago

I implemented your solution, thanks again for the new knowledge about constants!