/** Compiles an integer literal to bytecode */ void compile_int(GVMT_Object o, R_environment env, R_bytes b) { intptr_t i = unbox(o); if (((int8_t)i) == i) { bytes_append(b, op(byte)); bytes_append(b, i); } else if (((int16_t)i) == i) { bytes_append(b, op(short)); bytes_append(b, (i >> 8)); bytes_append(b, i); } else {
static int httpsrv_handle_access(void *cls, struct MHD_Connection *conn, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **con_cls) { bytes_t *upbuf; if (!*con_cls) { *con_cls = upbuf = malloc(sizeof(bytes_t)); bytes_init(upbuf); return MHD_YES; } upbuf = *con_cls; if (*upload_data_size) { bytes_append(upbuf, upload_data, *upload_data_size); *upload_data_size = 0; return MHD_YES; } return httpsrv_handle_req(conn, url, method, *con_cls); }