Skip to content

Commit b1d9dba

Browse files
authored
Merge pull request DeusData#1870 from DeusData/chore/1298-surviving-subset
chore(headers): sync stale decl names, name genuine buffer sizes (distilled from DeusData#1298)
2 parents 638b116 + 7fe2f87 commit b1d9dba

3 files changed

Lines changed: 19 additions & 15 deletions

File tree

‎src/daemon/runtime.h‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <stddef.h>
1717
#include <stdint.h>
1818

19+
#define CBM_DAEMON_SEMVER_SIZE 12U
20+
1921
/* Detailed post-admission operation ABI. It is deliberately absent from the
2022
* stable endpoint HELLO: an exact executable fingerprint already selects this
2123
* layout, while conflicting generations must remain able to diagnose each
@@ -262,7 +264,7 @@ typedef struct {
262264
uint8_t client_count; /* entries in client_pids, capped at the wire limit */
263265
uint32_t client_pids[CBM_DAEMON_CONTROL_CLIENT_CAP];
264266
char build_fingerprint[CBM_DAEMON_BUILD_FINGERPRINT_SIZE];
265-
char semantic_version[12];
267+
char semantic_version[CBM_DAEMON_SEMVER_SIZE];
266268
} cbm_daemon_runtime_status_t;
267269

268270
typedef struct {

‎src/pipeline/pass_lsp_cross.h‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,9 @@ void cbm_pxc_filter_stats(uint64_t *defs_registered, uint64_t *build_files, uint
143143

144144
static inline CBMTypeRegistry *cbm_pxc_registry_for_lang(const CBMCrossLspRegistries *r,
145145
CBMLanguage lang) {
146-
if (!r)
146+
if (!r) {
147147
return NULL;
148+
}
148149
switch (lang) {
149150
case CBM_LANG_GO:
150151
return r->go;
@@ -177,17 +178,17 @@ const struct CBMCargoManifest *cbm_pxc_get_rust_manifest(void);
177178

178179
/* Run the cross-file LSP resolver for non-TS languages. Appends
179180
* resolved CALLS into r->resolved_calls (lives in r->arena). Caller
180-
* owns source, module_qn, all_defs, imp_keys, imp_vals.
181-
* NOTE: all_defs is read-only in practice but typed non-const to match
181+
* owns source, module_qn, defs, imp_names, imp_qns.
182+
* NOTE: defs is read-only in practice but typed non-const to match
182183
* the existing cbm_run_X_lsp_cross callee signatures. */
183184
void cbm_pxc_run_one(CBMLanguage lang, CBMFileResult *r, const char *source, int source_len,
184-
const char *module_qn, CBMLSPDef *all_defs, int def_count,
185-
const char **imp_keys, const char **imp_vals, int imp_count);
185+
const char *module_qn, CBMLSPDef *defs, int def_count, const char **imp_names,
186+
const char **imp_qns, int imp_count);
186187

187188
/* TS / JS / JSX / TSX variant with explicit dialect flags. */
188189
void cbm_pxc_run_one_ts(CBMFileResult *r, const char *source, int source_len, const char *module_qn,
189-
CBMLSPDef *all_defs, int def_count, const char **imp_keys,
190-
const char **imp_vals, int imp_count, bool js_mode, bool jsx_mode,
190+
CBMLSPDef *defs, int def_count, const char **imp_names,
191+
const char **imp_qns, int imp_count, bool js_mode, bool jsx_mode,
191192
bool dts_mode);
192193

193194
/* Per-file cross-LSP dispatch shared by the parallel resolve worker AND the

‎src/ui/httpd.h‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030

3131
#include <stdbool.h>
3232
#include <stddef.h>
33+
#include "../foundation/constants.h"
3334

3435
/* Maximum request head (request line + headers + terminating CRLFCRLF). */
3536
#define CBM_HTTP_MAX_HEAD (16 * 1024)
@@ -51,14 +52,14 @@ typedef enum {
5152
* Selected headers are copied for the routing/security layer ("" when
5253
* absent). `body` is heap-allocated and NUL-terminated. */
5354
typedef struct {
54-
char method[16];
55-
char path[2048];
56-
char query[2048];
55+
char method[CBM_SZ_16];
56+
char path[CBM_SZ_2K];
57+
char query[CBM_SZ_2K];
5758
unsigned char http_minor; /* 0 for HTTP/1.0, 1 for HTTP/1.1 */
58-
char origin[256];
59-
char host[256];
60-
char content_type[128];
61-
char accept_language[256];
59+
char origin[CBM_SZ_256];
60+
char host[CBM_SZ_256];
61+
char content_type[CBM_SZ_128];
62+
char accept_language[CBM_SZ_256];
6263
char *body;
6364
size_t body_len;
6465
} cbm_http_req_t;

0 commit comments

Comments
 (0)