From 896dae59f654c2e82e2b25ca05355216bf9ac8ed Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Tue, 3 Jan 2023 16:12:08 +0100 Subject: [PATCH] gluon-web: fix c indentation --- package/gluon-web/src/template_lmo.c | 6 ++-- package/gluon-web/src/template_lualib.c | 12 +++---- package/gluon-web/src/template_parser.c | 2 +- package/gluon-web/src/template_utils.c | 44 ++++++++++++------------- 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/package/gluon-web/src/template_lmo.c b/package/gluon-web/src/template_lmo.c index 062497b3..d7b442a7 100644 --- a/package/gluon-web/src/template_lmo.c +++ b/package/gluon-web/src/template_lmo.c @@ -38,9 +38,9 @@ static inline uint16_t get_le16(const void *data) { static inline uint32_t get_be32(const void *data) { const uint8_t *d = data; return (((uint32_t)d[0]) << 24) - | (((uint32_t)d[1]) << 16) - | (((uint32_t)d[2]) << 8) - | d[3]; + | (((uint32_t)d[1]) << 16) + | (((uint32_t)d[2]) << 8) + | d[3]; } /* diff --git a/package/gluon-web/src/template_lualib.c b/package/gluon-web/src/template_lualib.c index 308011f9..819de379 100644 --- a/package/gluon-web/src/template_lualib.c +++ b/package/gluon-web/src/template_lualib.c @@ -97,8 +97,8 @@ static int template_L_load_catalog(lua_State *L) return 0; } - luaL_getmetatable(L, TEMPLATE_CATALOG); - lua_setmetatable(L, -2); + luaL_getmetatable(L, TEMPLATE_CATALOG); + lua_setmetatable(L, -2); return 1; } @@ -106,7 +106,7 @@ static int template_L_load_catalog(lua_State *L) static int template_catalog_call(lua_State *L) { size_t inlen, outlen; - lmo_catalog_t *cat = luaL_checkudata(L, 1, TEMPLATE_CATALOG); + lmo_catalog_t *cat = luaL_checkudata(L, 1, TEMPLATE_CATALOG); const char *in = luaL_checklstring(L, 2, &inlen), *out; if (!lmo_translate(cat, in, inlen, &out, &outlen)) return 0; @@ -118,7 +118,7 @@ static int template_catalog_call(lua_State *L) static int template_catalog_gc(lua_State *L) { - lmo_catalog_t *cat = luaL_checkudata(L, 1, TEMPLATE_CATALOG); + lmo_catalog_t *cat = luaL_checkudata(L, 1, TEMPLATE_CATALOG); lmo_unload(cat); return 0; @@ -133,8 +133,8 @@ static const luaL_reg R[] = { }; static const luaL_reg template_catalog_methods[] = { - { "__call", template_catalog_call }, - { "__gc", template_catalog_gc }, + { "__call", template_catalog_call }, + { "__gc", template_catalog_gc }, {} }; diff --git a/package/gluon-web/src/template_parser.c b/package/gluon-web/src/template_parser.c index d71afe72..84f053ae 100644 --- a/package/gluon-web/src/template_parser.c +++ b/package/gluon-web/src/template_parser.c @@ -414,7 +414,7 @@ int template_error(lua_State *L, struct template_parser *parser) } snprintf(msg, sizeof(msg), "Syntax error in %s:%d: %s", - parser->file ?: "[string]", line + chunkline, err ?: "(unknown error)"); + parser->file ?: "[string]", line + chunkline, err ?: "(unknown error)"); lua_pushnil(L); lua_pushinteger(L, line + chunkline); diff --git a/package/gluon-web/src/template_utils.c b/package/gluon-web/src/template_utils.c index c07eab52..d2d9d79e 100644 --- a/package/gluon-web/src/template_utils.c +++ b/package/gluon-web/src/template_utils.c @@ -130,37 +130,37 @@ static inline bool mb_is_shortest(const unsigned char *s, size_t n) case 2: /* 1100000x (10xxxxxx) */ return !(((*s >> 1) == 0x60) && - ((*(s+1) >> 6) == 0x02)); + ((*(s+1) >> 6) == 0x02)); case 3: /* 11100000 100xxxxx (10xxxxxx) */ return !((*s == 0xE0) && - ((*(s+1) >> 5) == 0x04) && - ((*(s+2) >> 6) == 0x02)); + ((*(s+1) >> 5) == 0x04) && + ((*(s+2) >> 6) == 0x02)); case 4: /* 11110000 1000xxxx (10xxxxxx 10xxxxxx) */ return !((*s == 0xF0) && - ((*(s+1) >> 4) == 0x08) && - ((*(s+2) >> 6) == 0x02) && - ((*(s+3) >> 6) == 0x02)); + ((*(s+1) >> 4) == 0x08) && + ((*(s+2) >> 6) == 0x02) && + ((*(s+3) >> 6) == 0x02)); case 5: /* 11111000 10000xxx (10xxxxxx 10xxxxxx 10xxxxxx) */ return !((*s == 0xF8) && - ((*(s+1) >> 3) == 0x10) && - ((*(s+2) >> 6) == 0x02) && - ((*(s+3) >> 6) == 0x02) && - ((*(s+4) >> 6) == 0x02)); + ((*(s+1) >> 3) == 0x10) && + ((*(s+2) >> 6) == 0x02) && + ((*(s+3) >> 6) == 0x02) && + ((*(s+4) >> 6) == 0x02)); case 6: /* 11111100 100000xx (10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx) */ return !((*s == 0xF8) && - ((*(s+1) >> 2) == 0x20) && - ((*(s+2) >> 6) == 0x02) && - ((*(s+3) >> 6) == 0x02) && - ((*(s+4) >> 6) == 0x02) && - ((*(s+5) >> 6) == 0x02)); + ((*(s+1) >> 2) == 0x20) && + ((*(s+2) >> 6) == 0x02) && + ((*(s+3) >> 6) == 0x02) && + ((*(s+4) >> 6) == 0x02) && + ((*(s+5) >> 6) == 0x02)); } return true; @@ -270,18 +270,18 @@ bool pcdata(const char *s, size_t l, char **out, size_t *outl) for (o = 0; o < l; o++) { /* Invalid XML bytes */ if ((*ptr <= 0x08) || - ((*ptr >= 0x0B) && (*ptr <= 0x0C)) || - ((*ptr >= 0x0E) && (*ptr <= 0x1F)) || - (*ptr == 0x7F)) { + ((*ptr >= 0x0B) && (*ptr <= 0x0C)) || + ((*ptr >= 0x0E) && (*ptr <= 0x1F)) || + (*ptr == 0x7F)) { ptr++; } /* Escapes */ else if ((*ptr == '\'') || - (*ptr == '"') || - (*ptr == '&') || - (*ptr == '<') || - (*ptr == '>')) { + (*ptr == '"') || + (*ptr == '&') || + (*ptr == '<') || + (*ptr == '>')) { esl = snprintf(esq, sizeof(esq), "&#%i;", *ptr); if (!buf_append(buf, esq, esl))