* or qcint; however, it's incredibly unsafe for two reasons.
* 1) The compilers aliasing optimization can legally make it unstable
* (it's undefined behaviour).
- *
+ *
* 2) The cast itself depends on fresh storage (newly allocated in which
* ever function is using the cast macros), the contents of which are
* transferred in a way that the obligation to release storage is not
/*
* These are not part of the header but we ensure LE format here to save on duplicated
* code.
- */
+ */
util_endianswap(code->statements, vec_size(code->statements), sizeof(prog_section_statement));
util_endianswap(code->defs, vec_size(code->defs), sizeof(prog_section_def));
util_endianswap(code->fields, vec_size(code->fields), sizeof(prog_section_field));
* Same principle except this one allocates memory and writes the lno(optional) and the dat file
* directly out to allocated memory. Which is actually very useful for the future library support
* we're going to add.
- */
+ */
bool code_write_memory(code_t *code, uint8_t **datmem, size_t *sizedat, uint8_t **lnomem, size_t *sizelno) {
prog_header code_header;
uint32_t offset = 0;
int security_decode(unsigned char *dest, const unsigned char *src, int srclen) {
unsigned char *p;
- if(!*src)
+ if(!*src)
return 0;
*dest = 0;
if(!isbase64(src[1])) {
p -= 2;
break;
- }
+ }
else if(!isbase64(src[2])) {
p -= 2;
break;
- }
+ }
else if(!isbase64(src[3])) {
p--;
break;
* If more platforms are supported add the entries between the start
* tag here, and the end tag below. Nothing else needs to be done
* <tag> (the table needs to match the HTML too)
- */
+ */
#define ARCHLINUX_32_REF "%sgmqcc-%c.%c.%c-1-i686.pkg.tar.xz%s"
#define ARCHLINUX_64_REF "%sgmqcc-%c.%c.%c-1-x86_64.pkg.tar.xz%s"
#define DEBIAN_32_REF "%sgmqcc-%c.%c.%c-i686.deb%s"
char hexstr[3];
unsigned int i=0;
unsigned long l=0;
-
+
p = str->data;
for(i=0; i < str->len; i++) {
if((p - str->data) >= str->len)
/*
* Builds a list of download links with the right version and handles the
* rest of the magic.
- */
+ */
void build(const char *directory) {
/* Figure out version number */
char find[3];
/* cast for return required for C++ */
if (str < 0 || str >= (qcint)vec_size(prog->strings))
return "<<<invalid string>>>";
-
+
return prog->strings + str;
}
size_t len1, len2;
qcany *str1, *str2;
qcany out;
-
+
const char *cstr1;
const char *cstr2;
const char *cstr1;
const char *cstr2;
-
+
if (prog->argc != 2 && prog->argc != 3) {
fprintf(stderr, "ERROR: invalid number of arguments for strcmp/strncmp: %i, expected 2 or 3\n",
prog->argc);
char c;
while ((c = *(src++))) {
switch(c) {
- case '\t':
+ case '\t':
*(dest++) = '\\', *(dest++) = 't';
break;
- case '\n':
+ case '\n':
*(dest++) = '\\', *(dest++) = 'n';
break;
- case '\r':
+ case '\r':
*(dest++) = '\\', *(dest++) = 'r';
break;
- case '\\':
+ case '\\':
*(dest++) = '\\', *(dest++) = '\\';
break;
- case '\"':
+ case '\"':
*(dest++) = '\\', *(dest++) = '\"';
break;
default:
/*
* ctime and its fucking annoying newline char, no worries, we're
* professionals here.
- */
+ */
find = ctime(&finfo.st_mtime);
value = (char*)mem_a(strlen(find) + 1);
memcpy(&value[1], find, (size = strlen(find)) - 1);
* code_genstrin -- generates string for code
* code_alloc_field -- allocated a field
* code_push_statement -- keeps statements and linenumbers together
- * code_pop_statement -- keeps statements and linenumbers together
+ * code_pop_statement -- keeps statements and linenumbers together
*/
bool code_write (code_t *, const char *filename, const char *lno);
GMQCC_WARN
/*
* This code assumes 32 bit floats while generating binary
* Blub: don't use extern here, it's annoying and shows up in nm
- * for some reason :P
+ * for some reason :P
*/
typedef int static_assert_is_32bit_float [(sizeof(int32_t) == 4)?1:-1];
typedef int static_assert_is_32bit_integer[(sizeof(qcfloat) == 4)?1:-1];
#else
if (lex->tok.value)
vec_shrinkto(lex->tok.value, 0);
-
+
lex->tok.constval.t = 0;
lex->tok.ctx.line = lex->sline;
lex->tok.ctx.file = lex->name;
lex->line++;
lex->column = 0;
}
-
+
if (c2 != '?') {
lex_ungetch(lex, c2);
return old;
lex->line++;
lex->column = 0;
}
-
+
switch (c3) {
case '=': return '#';
case '/': return '\\';
pak_close(pak);
vec_free(files);
stat_info();
-
+
return EXIT_SUCCESS;
}
}
vec_push(func->blocks, block);
-
+
parser->function = old;
if (!parser_leaveblock(parser))
allocated = (char*)mem_a(4096); /* A page must be enough */
strerror_s(allocated, 4096, num);
-
+
vec_push(vector, allocated);
return (const char *)allocated;
}