Новый убийца Си опроверг арифметику24.07.2024 10:15
(ctargs) std::string gsprint {
std::thread::spinlock::lock(&std::sprintBufferSL);
if(!std::sbInitialized) {
std::sprintBuffer = std::string(128);
std::sbInitialized = true;
}
else std::sprintBuffer.length = 0;
char[40] nBuffer;
@foreachArgs() {
@if(@tNequals(@getCurrArgType(), float)) {
@if(@tNequals(@getCurrArgType(), double)) {
@if(@tNequals(@getCurrArgType(), std::string)) {
@if(@tNequals(@getCurrArgType(), char)) {
@if(@tEquals(@getCurrArgType(), bool)) {
std::sprintBuffer.appendC(std::cstring::fromBool(@getCurrArg(bool)));
};
@if(@tEquals(@getCurrArgType(), short) || @tEquals(@getCurrArgType(), int) || @tEquals(@getCurrArgType(), long)) {
nBuffer = [
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
];
std::cstring::ltos(@getCurrArg(long), cast(char*)&nBuffer);
std::sprintBuffer.appendC(cast(char*)&nBuffer);
};
@if(@tEquals(@getCurrArgType(), cent)) {
nBuffer = [
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
];
std::cstring::ctos(@getCurrArg(cent), cast(char*)&nBuffer);
std::sprintBuffer.appendC(cast(char*)&nBuffer);
};
@if(@tEquals(@getCurrArgType(), std::u32string)) {
std::u32string us = @getCurrArg(std::u32string);
for(int i=0; i std::sprintBuffer;
(ctargs) std::string sprint {
std::string result = "";
char[40] buffer;
@foreachArgs() {
@if(@tNequals(@getCurrArgType(), float)) {
@if(@tNequals(@getCurrArgType(), double)) {
@if(@tNequals(@getCurrArgType(), std::string)) {
@if(@tNequals(@getCurrArgType(), char)) {
@if(@tEquals(@getCurrArgType(), bool)) {
result.appendC(std::cstring::fromBool(@getCurrArg(bool)));
};
@if(@tEquals(@getCurrArgType(), short) || @tEquals(@getCurrArgType(), int) || @tEquals(@getCurrArgType(), long)) {
nBuffer = [
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
];
std::cstring::ltos(@getCurrArg(long), cast(char*)&nBuffer);
std::sprintBuffer.appendC(cast(char*)&nBuffer);
};
@if(@tEquals(@getCurrArgType(), cent)) {
nBuffer = [
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0',
'\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0'
];
std::cstring::ctos(@getCurrArg(cent), cast(char*)&nBuffer);
std::sprintBuffer.appendC(cast(char*)&nBuffer);
};
@if(@tEquals(@getCurrArgType(), std::u32string)) {
std::u32string us = @getCurrArg(std::u32string);
for(int i=0; i result;
© Habrahabr.ru