return CODE_HASH_LEAVE(existing);
CODE_HASH_LEAVE(existing) = vec_size(code->chars);
- vec_upload(code->chars, str, strlen(str)+1);
+ vec_append(code->chars, strlen(str)+1, str);
util_htseth(code->string_cache, str, hash, CODE_HASH_ENTER(existing));
return CODE_HASH_LEAVE(existing);
/* handle the odd non string constant case so it works like C */
if (ftepp->token != TOKEN_STRINGCONST) {
bool store = false;
- vec_upload(message, "#warning", 8);
+ vec_append(message, 8, "#warning");
ftepp_next(ftepp);
while (ftepp->token != TOKEN_EOL) {
- vec_upload(message, ftepp_tokval(ftepp), strlen(ftepp_tokval(ftepp)));
+ vec_append(message, strlen(ftepp_tokval(ftepp)), ftepp_tokval(ftepp));
ftepp_next(ftepp);
}
vec_push(message, '\0');
/* handle the odd non string constant case so it works like C */
if (ftepp->token != TOKEN_STRINGCONST) {
- vec_upload(message, "#error", 6);
+ vec_append(message, 6, "#error");
ftepp_next(ftepp);
while (ftepp->token != TOKEN_EOL) {
- vec_upload(message, ftepp_tokval(ftepp), strlen(ftepp_tokval(ftepp)));
+ vec_append(message, strlen(ftepp_tokval(ftepp)), ftepp_tokval(ftepp));
ftepp_next(ftepp);
}
vec_push(message, '\0');
/* handle the odd non string constant case so it works like C */
if (ftepp->token != TOKEN_STRINGCONST) {
- vec_upload(message, "#message", 8);
+ vec_append(message, 8, "#message");
ftepp_next(ftepp);
while (ftepp->token != TOKEN_EOL) {
- vec_upload(message, ftepp_tokval(ftepp), strlen(ftepp_tokval(ftepp)));
+ vec_append(message, strlen(ftepp_tokval(ftepp)), ftepp_tokval(ftepp));
ftepp_next(ftepp);
}
vec_push(message, '\0');
return;
}
- vec_upload(create, "#define ", 8);
- vec_upload(create, name, strlen(name));
+ vec_append(create, 8, "#define ");
+ vec_append(create, strlen(name), name);
vec_push (create, ' ');
- vec_upload(create, value, strlen(value));
+ vec_append(create, strlen(value), value);
vec_push (create, 0);
ftepp_preprocess_string(ftepp, "__builtin__", create);
#define vec_shrinkto(A,N) ((void)(vec_meta(A)->used = (N)))
#define vec_shrinkby(A,N) ((void)(vec_meta(A)->used -= (N)))
#define vec_append(A,N,S) ((void)(memcpy(vec_add((A), (N)), (S), (N) * sizeof(*(S)))))
-#define vec_upload(X,Y,S) ((void)(memcpy(vec_add((X), (S) * sizeof(*(Y))), (Y), (S) * sizeof(*(Y)))))
#define vec_remove(A,I,N) ((void)(memmove((A)+(I),(A)+((I)+(N)),sizeof(*(A))*(vec_meta(A)->used-(I)-(N))),vec_meta(A)->used-=(N)))
typedef struct correct_trie_s {
strcmp(section, "warnings") &&
strcmp(section, "optimizations"))
{
- vec_upload(error, "invalid section `", 17);
- vec_upload(error, section, strlen(section));
+ vec_append(error, 17, "invalid section `");
+ vec_append(error, strlen(section), section);
vec_push (error, '`');
vec_push (error, '\0');
} else {
- vec_upload(error, "invalid variable `", 18);
- vec_upload(error, name, strlen(name));
+ vec_append(error, 18, "invalid variable `");
+ vec_append(error, strlen(name), name);
vec_push (error, '`');
- vec_upload(error, " in section: `", 14);
- vec_upload(error, section, strlen(section));
+ vec_append(error, 14, " in section: `");
+ vec_append(error, strlen(section), section);
vec_push (error, '`');
vec_push (error, '\0');
}