mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
5535: Updated french language r=def- a=Chairn ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) 5536: Fix more unsafe define r=def- a=Chairn Fix some unsafe define that can expand in an undesired way if used with some bitwise operator (very unlikely though) ## Checklist - [ ] Tested the change ingame - [ ] Provided screenshots if it is a visual change - [ ] Tested in combination with possibly related configuration options - [ ] Written a unit test if it works standalone, system.c especially - [ ] Considered possible null pointers and out of bounds array indexing - [ ] Changed no physics that affect existing maps - [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional) Co-authored-by: Chairn <chairn.nq@hotmail.fr>
This commit is contained in:
commit
c345bc6993
|
@ -1038,7 +1038,7 @@ AntiPing
|
||||||
== AntiPing
|
== AntiPing
|
||||||
|
|
||||||
Enable long pain sound (used when shooting in freeze)
|
Enable long pain sound (used when shooting in freeze)
|
||||||
== Activer les sons de douleur du Tee (utilisé lorsqu'un Tee tire depuis le freeze (gèle))
|
== Activer les sons de douleur du Tee (utilisé lorsqu'un Tee tire depuis le freeze (gel))
|
||||||
|
|
||||||
9+ new mentions
|
9+ new mentions
|
||||||
== 9+ nouveaux messages
|
== 9+ nouveaux messages
|
||||||
|
@ -1479,16 +1479,16 @@ Show player target angle
|
||||||
== Afficher l'angle de visée
|
== Afficher l'angle de visée
|
||||||
|
|
||||||
Show jump indicator
|
Show jump indicator
|
||||||
==
|
== Indicateur de sauts
|
||||||
|
|
||||||
Opacity of freeze bars inside freeze
|
Opacity of freeze bars inside freeze
|
||||||
==
|
== Opacité de la barre de gel dans le gel
|
||||||
|
|
||||||
Normal Color
|
Normal Color
|
||||||
==
|
== Couleur normal
|
||||||
|
|
||||||
Highlight Color
|
Highlight Color
|
||||||
==
|
== Couleur surbrillante
|
||||||
|
|
||||||
Extras
|
Extras
|
||||||
==
|
== Extras
|
||||||
|
|
|
@ -63,7 +63,7 @@ static u32 Gamma1(u32 x) { return Rot(x, 17) ^ Rot(x, 19) ^ Sh(x, 10); }
|
||||||
|
|
||||||
static void sha_compress(sha256_state *md, const unsigned char *buf)
|
static void sha_compress(sha256_state *md, const unsigned char *buf)
|
||||||
{
|
{
|
||||||
u32 S[8], W[64], t0, t1, t;
|
u32 S[8], W[64], t;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Copy state into S
|
// Copy state into S
|
||||||
|
@ -80,12 +80,13 @@ static void sha_compress(sha256_state *md, const unsigned char *buf)
|
||||||
|
|
||||||
// Compress
|
// Compress
|
||||||
#define RND(a, b, c, d, e, f, g, h, i) \
|
#define RND(a, b, c, d, e, f, g, h, i) \
|
||||||
|
do \
|
||||||
{ \
|
{ \
|
||||||
t0 = h + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \
|
u32 t0 = (h) + Sigma1(e) + Ch(e, f, g) + K[i] + W[i]; \
|
||||||
t1 = Sigma0(a) + Maj(a, b, c); \
|
u32 t1 = Sigma0(a) + Maj(a, b, c); \
|
||||||
d += t0; \
|
(d) += t0; \
|
||||||
h = t0 + t1; \
|
(h) = t0 + t1; \
|
||||||
}
|
} while(0)
|
||||||
|
|
||||||
for(i = 0; i < 64; ++i)
|
for(i = 0; i < 64; ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4406,6 +4406,7 @@ void CClient::RegisterCommands()
|
||||||
|
|
||||||
#define CONSOLE_COMMAND(name, params, flags, callback, userdata, help) m_pConsole->Register(name, params, flags, 0, 0, help);
|
#define CONSOLE_COMMAND(name, params, flags, callback, userdata, help) m_pConsole->Register(name, params, flags, 0, 0, help);
|
||||||
#include <game/ddracecommands.h>
|
#include <game/ddracecommands.h>
|
||||||
|
#undef CONSOLE_COMMAND
|
||||||
}
|
}
|
||||||
|
|
||||||
static CClient *CreateClient()
|
static CClient *CreateClient()
|
||||||
|
|
|
@ -82,13 +82,13 @@ bool CConfigManager::Save()
|
||||||
char aEscapeBuf[1024 * 2];
|
char aEscapeBuf[1024 * 2];
|
||||||
|
|
||||||
#define MACRO_CONFIG_INT(Name, ScriptName, def, min, max, flags, desc) \
|
#define MACRO_CONFIG_INT(Name, ScriptName, def, min, max, flags, desc) \
|
||||||
if((flags)&CFGFLAG_SAVE && g_Config.m_##Name != def) \
|
if((flags)&CFGFLAG_SAVE && g_Config.m_##Name != (def)) \
|
||||||
{ \
|
{ \
|
||||||
str_format(aLineBuf, sizeof(aLineBuf), "%s %i", #ScriptName, g_Config.m_##Name); \
|
str_format(aLineBuf, sizeof(aLineBuf), "%s %i", #ScriptName, g_Config.m_##Name); \
|
||||||
WriteLine(aLineBuf); \
|
WriteLine(aLineBuf); \
|
||||||
}
|
}
|
||||||
#define MACRO_CONFIG_COL(Name, ScriptName, def, flags, desc) \
|
#define MACRO_CONFIG_COL(Name, ScriptName, def, flags, desc) \
|
||||||
if((flags)&CFGFLAG_SAVE && g_Config.m_##Name != def) \
|
if((flags)&CFGFLAG_SAVE && g_Config.m_##Name != (def)) \
|
||||||
{ \
|
{ \
|
||||||
str_format(aLineBuf, sizeof(aLineBuf), "%s %u", #ScriptName, g_Config.m_##Name); \
|
str_format(aLineBuf, sizeof(aLineBuf), "%s %u", #ScriptName, g_Config.m_##Name); \
|
||||||
WriteLine(aLineBuf); \
|
WriteLine(aLineBuf); \
|
||||||
|
|
|
@ -132,19 +132,25 @@ int CHuffman::Compress(const void *pInput, int InputSize, void *pOutput, int Out
|
||||||
{
|
{
|
||||||
// this macro loads a symbol for a byte into bits and bitcount
|
// this macro loads a symbol for a byte into bits and bitcount
|
||||||
#define HUFFMAN_MACRO_LOADSYMBOL(Sym) \
|
#define HUFFMAN_MACRO_LOADSYMBOL(Sym) \
|
||||||
Bits |= m_aNodes[Sym].m_Bits << Bitcount; \
|
do \
|
||||||
Bitcount += m_aNodes[Sym].m_NumBits;
|
{ \
|
||||||
|
Bits |= m_aNodes[Sym].m_Bits << Bitcount; \
|
||||||
|
Bitcount += m_aNodes[Sym].m_NumBits; \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
// this macro writes the symbol stored in bits and bitcount to the dst pointer
|
// this macro writes the symbol stored in bits and bitcount to the dst pointer
|
||||||
#define HUFFMAN_MACRO_WRITE() \
|
#define HUFFMAN_MACRO_WRITE() \
|
||||||
while(Bitcount >= 8) \
|
do \
|
||||||
{ \
|
{ \
|
||||||
*pDst++ = (unsigned char)(Bits & 0xff); \
|
while(Bitcount >= 8) \
|
||||||
if(pDst == pDstEnd) \
|
{ \
|
||||||
return -1; \
|
*pDst++ = (unsigned char)(Bits & 0xff); \
|
||||||
Bits >>= 8; \
|
if(pDst == pDstEnd) \
|
||||||
Bitcount -= 8; \
|
return -1; \
|
||||||
}
|
Bits >>= 8; \
|
||||||
|
Bitcount -= 8; \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
// setup buffer pointers
|
// setup buffer pointers
|
||||||
const unsigned char *pSrc = (const unsigned char *)pInput;
|
const unsigned char *pSrc = (const unsigned char *)pInput;
|
||||||
|
@ -165,23 +171,23 @@ int CHuffman::Compress(const void *pInput, int InputSize, void *pOutput, int Out
|
||||||
while(pSrc != pSrcEnd)
|
while(pSrc != pSrcEnd)
|
||||||
{
|
{
|
||||||
// {B} load the symbol
|
// {B} load the symbol
|
||||||
HUFFMAN_MACRO_LOADSYMBOL(Symbol)
|
HUFFMAN_MACRO_LOADSYMBOL(Symbol);
|
||||||
|
|
||||||
// {C} fetch next symbol, this is done here because it will reduce dependency in the code
|
// {C} fetch next symbol, this is done here because it will reduce dependency in the code
|
||||||
Symbol = *pSrc++;
|
Symbol = *pSrc++;
|
||||||
|
|
||||||
// {B} write the symbol loaded at
|
// {B} write the symbol loaded at
|
||||||
HUFFMAN_MACRO_WRITE()
|
HUFFMAN_MACRO_WRITE();
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the last symbol loaded from {C} or {A} in the case of only 1 byte input buffer
|
// write the last symbol loaded from {C} or {A} in the case of only 1 byte input buffer
|
||||||
HUFFMAN_MACRO_LOADSYMBOL(Symbol)
|
HUFFMAN_MACRO_LOADSYMBOL(Symbol);
|
||||||
HUFFMAN_MACRO_WRITE()
|
HUFFMAN_MACRO_WRITE();
|
||||||
}
|
}
|
||||||
|
|
||||||
// write EOF symbol
|
// write EOF symbol
|
||||||
HUFFMAN_MACRO_LOADSYMBOL(HUFFMAN_EOF_SYMBOL)
|
HUFFMAN_MACRO_LOADSYMBOL(HUFFMAN_EOF_SYMBOL);
|
||||||
HUFFMAN_MACRO_WRITE()
|
HUFFMAN_MACRO_WRITE();
|
||||||
|
|
||||||
// write out the last bits
|
// write out the last bits
|
||||||
*pDst++ = Bits;
|
*pDst++ = Bits;
|
||||||
|
|
|
@ -32,6 +32,7 @@ CChat::CChat()
|
||||||
|
|
||||||
#define CHAT_COMMAND(name, params, flags, callback, userdata, help) RegisterCommand(name, params, flags, help);
|
#define CHAT_COMMAND(name, params, flags, callback, userdata, help) RegisterCommand(name, params, flags, help);
|
||||||
#include <game/ddracechat.h>
|
#include <game/ddracechat.h>
|
||||||
|
#undef CHAT_COMMAND
|
||||||
std::sort(m_vCommands.begin(), m_vCommands.end());
|
std::sort(m_vCommands.begin(), m_vCommands.end());
|
||||||
|
|
||||||
m_Mode = MODE_NONE;
|
m_Mode = MODE_NONE;
|
||||||
|
|
|
@ -44,7 +44,7 @@ public:
|
||||||
CTuningParams()
|
CTuningParams()
|
||||||
{
|
{
|
||||||
const float TicksPerSecond = 50.0f;
|
const float TicksPerSecond = 50.0f;
|
||||||
#define MACRO_TUNING_PARAM(Name, ScriptName, Value, Description) m_##Name.Set((int)(Value * 100.0f));
|
#define MACRO_TUNING_PARAM(Name, ScriptName, Value, Description) m_##Name.Set((int)((Value)*100.0f));
|
||||||
#include "tuning.h"
|
#include "tuning.h"
|
||||||
#undef MACRO_TUNING_PARAM
|
#undef MACRO_TUNING_PARAM
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ int CMapBugs::Update(const char *pBug)
|
||||||
int Bug = -1;
|
int Bug = -1;
|
||||||
if(false) {} // NOLINT(readability-simplify-boolean-expr)
|
if(false) {} // NOLINT(readability-simplify-boolean-expr)
|
||||||
#define MAPBUG(constname, string) \
|
#define MAPBUG(constname, string) \
|
||||||
else if(str_comp(pBug, string) == 0) { Bug = constname; }
|
else if(str_comp(pBug, string) == 0) { Bug = (constname); }
|
||||||
#include "mapbugs_list.h"
|
#include "mapbugs_list.h"
|
||||||
#undef MAPBUG
|
#undef MAPBUG
|
||||||
if(Bug == -1)
|
if(Bug == -1)
|
||||||
|
|
|
@ -256,18 +256,18 @@ void CGameContext::ConRules(IConsole::IResult *pResult, void *pUserData)
|
||||||
"Be nice.");
|
"Be nice.");
|
||||||
Printed = true;
|
Printed = true;
|
||||||
}
|
}
|
||||||
#define _RL(n) g_Config.m_SvRulesLine##n
|
#define GET_SERVER_RULE_LINE(n) g_Config.m_SvRulesLine##n
|
||||||
char *pRuleLines[] = {
|
char *pRuleLines[] = {
|
||||||
_RL(1),
|
GET_SERVER_RULE_LINE(1),
|
||||||
_RL(2),
|
GET_SERVER_RULE_LINE(2),
|
||||||
_RL(3),
|
GET_SERVER_RULE_LINE(3),
|
||||||
_RL(4),
|
GET_SERVER_RULE_LINE(4),
|
||||||
_RL(5),
|
GET_SERVER_RULE_LINE(5),
|
||||||
_RL(6),
|
GET_SERVER_RULE_LINE(6),
|
||||||
_RL(7),
|
GET_SERVER_RULE_LINE(7),
|
||||||
_RL(8),
|
GET_SERVER_RULE_LINE(8),
|
||||||
_RL(9),
|
GET_SERVER_RULE_LINE(9),
|
||||||
_RL(10),
|
GET_SERVER_RULE_LINE(10),
|
||||||
};
|
};
|
||||||
for(auto &pRuleLine : pRuleLines)
|
for(auto &pRuleLine : pRuleLines)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue