From: terencehill Date: Fri, 8 Feb 2019 23:30:42 +0000 (+0100) Subject: Reduce function calls when writing 2 multi-line messages X-Git-Tag: xonotic-v0.8.5~1604^2~6 X-Git-Url: http://de.git.xonotic.org/?a=commitdiff_plain;h=c8d1187c6225c1d14ce4481d59a8abca5e79eb16;p=xonotic%2Fxonotic-data.pk3dir.git Reduce function calls when writing 2 multi-line messages --- diff --git a/qcsrc/common/effects/effectinfo.qc b/qcsrc/common/effects/effectinfo.qc index 474d41d1e..68c245db4 100644 --- a/qcsrc/common/effects/effectinfo.qc +++ b/qcsrc/common/effects/effectinfo.qc @@ -264,17 +264,18 @@ void effectinfo_read() void effectinfo_dump(int fh, bool alsoprint) { #define WRITE(str) write_String_To_File(fh, str, alsoprint) - WRITE("// ********************************************** //\n"); - WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n"); - WRITE("// ** ** //\n"); - WRITE("// ** This file is automatically generated by ** //\n"); - WRITE("// ** code with the command 'dumpeffectinfo'. ** //\n"); - WRITE("// ** ** //\n"); - WRITE("// ** If you modify an effect, please ** //\n"); - WRITE("// ** regenerate this file with that command. ** //\n"); - WRITE("// ** ** //\n"); - WRITE("// ********************************************** //\n"); - WRITE("\n"); + WRITE( + "// ********************************************** //\n" + "// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n" + "// ** ** //\n" + "// ** This file is automatically generated by ** //\n" + "// ** code with the command 'dumpeffectinfo'. ** //\n" + "// ** ** //\n" + "// ** If you modify an effect, please ** //\n" + "// ** regenerate this file with that command. ** //\n" + "// ** ** //\n" + "// ********************************************** //\n" + "\n"); for (EffectInfo it = NULL; (it = findfloat(it, instanceOfEffectInfo, true)); ) { if (it.classname == "vtbl") continue; diff --git a/qcsrc/common/notifications/all.qc b/qcsrc/common/notifications/all.qc index 107397758..11ebffacf 100644 --- a/qcsrc/common/notifications/all.qc +++ b/qcsrc/common/notifications/all.qc @@ -801,18 +801,19 @@ void Dump_Notifications(int fh, bool alsoprint) // notification variables for mutators or game modes or such and then // regenerate the notifications.cfg file from the new code. - NOTIF_WRITE("// ********************************************** //\n"); - NOTIF_WRITE("// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n"); - NOTIF_WRITE("// ** ** //\n"); - NOTIF_WRITE("// ** This file is automatically generated ** //\n"); - NOTIF_WRITE("// ** by code with the command 'dumpnotifs'. ** //\n"); - NOTIF_WRITE("// ** ** //\n"); - NOTIF_WRITE("// ** If you add a new notification, please ** //\n"); - NOTIF_WRITE("// ** regenerate this file with that command ** //\n"); - NOTIF_WRITE("// ** making sure that the output matches ** //\n"); - NOTIF_WRITE("// ** with the lists and defaults in code. ** //\n"); - NOTIF_WRITE("// ** ** //\n"); - NOTIF_WRITE("// ********************************************** //\n"); + NOTIF_WRITE( + "// ********************************************** //\n" + "// ** WARNING - DO NOT MANUALLY EDIT THIS FILE ** //\n" + "// ** ** //\n" + "// ** This file is automatically generated ** //\n" + "// ** by code with the command 'dumpnotifs'. ** //\n" + "// ** ** //\n" + "// ** If you add a new notification, please ** //\n" + "// ** regenerate this file with that command ** //\n" + "// ** making sure that the output matches ** //\n" + "// ** with the lists and defaults in code. ** //\n" + "// ** ** //\n" + "// ********************************************** //\n"); // These notifications will also append their string as a comment... // This is not necessary, and does not matter if they vary between config versions,