Skip to content

Commit

Permalink
some more locale guards
Browse files Browse the repository at this point in the history
  • Loading branch information
x42 committed Nov 24, 2015
1 parent eb5f5dc commit 778316b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions b_synth/lv2.c
Expand Up @@ -634,6 +634,7 @@ work(LV2_Handle instance,
// fprintf(stderr, "B3LV2: adding cfg line: %s\n", w->msg);
b3s->inst_offline = (b_instance*) calloc(1, sizeof(struct b_instance));
allocSynth(b3s->inst_offline);
LOCALEGUARD_START;
// clone current state...
rc_loop_state(b3s->inst->state, clone_cb_cfg, b3s->inst_offline);
// copy program info
Expand All @@ -643,6 +644,7 @@ work(LV2_Handle instance,
initSynth(b3s->inst_offline, SampleRateD);
// replay CCs after synth init
rc_loop_state(b3s->inst->state, clone_cb_mcc, b3s->inst_offline);
LOCALEGUARD_END;
w->status = 0;
}
break;
Expand All @@ -660,6 +662,7 @@ work(LV2_Handle instance,
fprintf(stderr, "B3LV2: loading cfg file: %s\n", w->msg);
b3s->inst_offline = (b_instance*) calloc(1, sizeof(struct b_instance));
allocSynth(b3s->inst_offline);

w->status = parseConfigurationFile (b3s->inst_offline, w->msg);
initSynth(b3s->inst_offline, SampleRateD);
break;
Expand All @@ -668,7 +671,9 @@ work(LV2_Handle instance,
x = fopen(w->msg, "w");
if (x) {
fprintf(x, "# setBfree config file\n# modificaions on top of default config\n");
LOCALEGUARD_START;
rc_loop_state(b3s->inst->state, rcsave_cb, (void*) x);
LOCALEGUARD_END;
fclose(x);
w->status = 0;
} else {
Expand Down
3 changes: 3 additions & 0 deletions src/cfgParser.c
Expand Up @@ -292,12 +292,15 @@ int parseConfigurationFile (void *inst, const char * fname) {
return -1;
}
else {
LOCALEGUARD_START;

while (fgets (lineBuf, LINEBUFSZ, fp) != NULL) {
lineNumber += 1; /* Increment the linenumber. */
parseConfigurationLine (inst, fname, lineNumber, lineBuf);
}

LOCALEGUARD_END;

fclose (fp);
}

Expand Down

0 comments on commit 778316b

Please sign in to comment.