Skip to content

Commit

Permalink
Make GCC more happier
Browse files Browse the repository at this point in the history
  • Loading branch information
kaetemi committed Feb 22, 2023
1 parent 0533f34 commit d587e8e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 38 deletions.
54 changes: 27 additions & 27 deletions ryzom/common/src/game_share/crypt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "crypt.h"

std::string rz_crypt(register const char *key, register const char *setting, char *buf);
std::string rz_crypt(NL_REGISTER const char *key, NL_REGISTER const char *setting, char *buf);
std::string __crypt_sha512(const char *key, const char *setting, char *output);


Expand Down Expand Up @@ -329,17 +329,17 @@ typedef union {
#define PERM3264(d,d0,d1,cpp,p) \
{ C_block tblk; rz_permute(cpp,&tblk,p,4); LOAD (d,d0,d1,tblk); }

int rz_des_setkey(register const char *key);
int rz_des_setkey(NL_REGISTER const char *key);
int rz_des_cipher(const char *in, char *out, long salt, int num_iter);
void rz_init_des();
void rz_init_perm(C_block perm[64/CHUNKBITS][1<<CHUNKBITS],
unsigned char p[64], int chars_in, int chars_out);


void rz_permute(unsigned char *cp, C_block *out, register C_block *p, int chars_in) {
register DCL_BLOCK(D,D0,D1);
register C_block *tp;
register int t;
void rz_permute(unsigned char *cp, C_block *out, NL_REGISTER C_block *p, int chars_in) {
NL_REGISTER DCL_BLOCK(D,D0,D1);
NL_REGISTER C_block *tp;
NL_REGISTER int t;

ZERO(D,D0,D1);
do {
Expand Down Expand Up @@ -508,10 +508,10 @@ static char cryptresult[1+4+4+11+1]; /* encrypted result */
* Return a pointer to static data consisting of the "setting"
* followed by an encryption produced by the "key" and "setting".
*/
std::string rz_crypt(register const char *key, register const char *setting, char *buf) {
register char *encp;
register long i;
register int t;
std::string rz_crypt(NL_REGISTER const char *key, NL_REGISTER const char *setting, char *buf) {
NL_REGISTER char *encp;
NL_REGISTER long i;
NL_REGISTER int t;
long salt;
int num_iter, salt_size;
C_block keyblock, rsltblock;
Expand Down Expand Up @@ -618,10 +618,10 @@ static C_block KS[KS_SIZE];
/*
* Set up the key schedule from the key.
*/
int rz_des_setkey(register const char *key) {
register DCL_BLOCK(K, K0, K1);
register C_block *ptabp;
register int i;
int rz_des_setkey(NL_REGISTER const char *key) {
NL_REGISTER DCL_BLOCK(K, K0, K1);
NL_REGISTER C_block *ptabp;
NL_REGISTER int i;
static int des_ready = 0;

if (!des_ready) {
Expand Down Expand Up @@ -653,11 +653,11 @@ int rz_des_setkey(register const char *key) {
int rz_des_cipher(const char *in, char *out, long salt, int num_iter) {
/* variables that we want in registers, most important first */
#if defined(pdp11)
register int j;
NL_REGISTER int j;
#endif
register long L0, L1, R0, R1, k;
register C_block *kp;
register int ks_inc, loop_count;
NL_REGISTER long L0, L1, R0, R1, k;
NL_REGISTER C_block *kp;
NL_REGISTER int ks_inc, loop_count;
C_block B;

L0 = salt;
Expand Down Expand Up @@ -766,9 +766,9 @@ int rz_des_cipher(const char *in, char *out, long salt, int num_iter) {
* done at compile time, if the compiler were capable of that sort of thing.
*/
/* STATIC */void rz_init_des() {
register int i, j;
register long k;
register int tableno;
NL_REGISTER int i, j;
NL_REGISTER long k;
NL_REGISTER int tableno;
static unsigned char perm[64], tmp32[32]; /* "static" for speed */

/*
Expand Down Expand Up @@ -909,7 +909,7 @@ int rz_des_cipher(const char *in, char *out, long salt, int num_iter) {
*/
/* STATIC */void rz_init_perm(C_block perm[64/CHUNKBITS][1<<CHUNKBITS],
unsigned char p[64], int /* chars_in */, int chars_out) {
register int i, j, k, l;
NL_REGISTER int i, j, k, l;

for (k = 0; k < chars_out*8; k++) { /* each output bit position */
l = p[k] - 1; /* where this bit comes from */
Expand All @@ -927,8 +927,8 @@ int rz_des_cipher(const char *in, char *out, long salt, int num_iter) {
/*
* "setkey" routine (for backwards compatibility)
*/
int rz_setkey(register const char *key) {
register int i, j, k;
int rz_setkey(NL_REGISTER const char *key) {
NL_REGISTER int i, j, k;
C_block keyblock;

for (i = 0; i < 8; i++) {
Expand All @@ -945,8 +945,8 @@ int rz_setkey(register const char *key) {
/*
* "encrypt" routine (for backwards compatibility)
*/
int rz_encrypt(register char *block, int flag) {
register int i, j, k;
int rz_encrypt(NL_REGISTER char *block, int flag) {
NL_REGISTER int i, j, k;
C_block cblock;

for (i = 0; i < 8; i++) {
Expand All @@ -972,7 +972,7 @@ int rz_encrypt(register char *block, int flag) {
#ifdef DEBUG_CRYPT
void prtab(char *s, unsigned char *t, int num_rows)
{
register int i, j;
NL_REGISTER int i, j;

(void)printf("%s:\n", s);
for (i = 0; i < num_rows; i++) {
Expand Down
6 changes: 3 additions & 3 deletions ryzom/server/src/ai_service/script_parser_lex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4280,9 +4280,9 @@ YY_MALLOC_DECL

YY_DECL
{
register yy_state_type yy_current_state;
register char *yy_cp, *yy_bp;
register int yy_act;
NL_REGISTER yy_state_type yy_current_state;
NL_REGISTER char *yy_cp, *yy_bp;
NL_REGISTER int yy_act;

#line 90 "ai_service/script_parser.lex"

Expand Down
16 changes: 8 additions & 8 deletions ryzom/server/src/ai_service/script_parser_yacc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ union yyalloc
# define YYCOPY(To, From, Count) \
do \
{ \
register YYSIZE_T yyi; \
NL_REGISTER YYSIZE_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(To)[yyi] = (From)[yyi]; \
} \
Expand Down Expand Up @@ -1203,7 +1203,7 @@ yystrlen (yystr)
const char *yystr;
# endif
{
register const char *yys = yystr;
NL_REGISTER const char *yys = yystr;

while (*yys++ != '\0')
continue;
Expand All @@ -1228,8 +1228,8 @@ yystpcpy (yydest, yysrc)
const char *yysrc;
# endif
{
register char *yyd = yydest;
register const char *yys = yysrc;
NL_REGISTER char *yyd = yydest;
NL_REGISTER const char *yys = yysrc;

while ((*yyd++ = *yys++) != '\0')
continue;
Expand Down Expand Up @@ -1359,8 +1359,8 @@ yyparse ()
#endif
{

register int yystate;
register int yyn;
NL_REGISTER int yystate;
NL_REGISTER int yyn;
int yyresult;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
Expand All @@ -1378,12 +1378,12 @@ yyparse ()
/* The state stack. */
short yyssa[YYINITDEPTH];
short *yyss = yyssa;
register short *yyssp;
NL_REGISTER short *yyssp;

/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
YYSTYPE *yyvs = yyvsa;
register YYSTYPE *yyvsp;
NL_REGISTER YYSTYPE *yyvsp;



Expand Down
2 changes: 2 additions & 0 deletions ryzom/server/src/frontend_service/quic_transceiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@

#include "nel/misc/types_nl.h"

#include <memory>
#include <atomic>

#include "nel/net/inet_address.h"
#include "fe_receive_task.h"

Expand Down

0 comments on commit d587e8e

Please sign in to comment.