| @@ -28,14 +28,14 @@ ScriptEngine* createScriptEngine(std::string extension) { | |||||
| static std::string editorPath; | static std::string editorPath; | ||||
| json_t *settingsToJson() { | |||||
| json_t *rootJ = json_object(); | |||||
| json_t* settingsToJson() { | |||||
| json_t* rootJ = json_object(); | |||||
| json_object_set_new(rootJ, "editorPath", json_string(editorPath.c_str())); | json_object_set_new(rootJ, "editorPath", json_string(editorPath.c_str())); | ||||
| return rootJ; | return rootJ; | ||||
| } | } | ||||
| void settingsFromJson(json_t *rootJ) { | |||||
| json_t *editorPathJ = json_object_get(rootJ, "editorPath"); | |||||
| void settingsFromJson(json_t* rootJ) { | |||||
| json_t* editorPathJ = json_object_get(rootJ, "editorPath"); | |||||
| if (editorPathJ) | if (editorPathJ) | ||||
| editorPath = json_string_value(editorPathJ); | editorPath = json_string_value(editorPathJ); | ||||
| } | } | ||||
| @@ -43,7 +43,7 @@ void settingsFromJson(json_t *rootJ) { | |||||
| void settingsLoad() { | void settingsLoad() { | ||||
| // Load plugin settings | // Load plugin settings | ||||
| std::string filename = asset::user("VCV-Prototype.json"); | std::string filename = asset::user("VCV-Prototype.json"); | ||||
| FILE *file = std::fopen(filename.c_str(), "r"); | |||||
| FILE* file = std::fopen(filename.c_str(), "r"); | |||||
| if (!file) { | if (!file) { | ||||
| return; | return; | ||||
| } | } | ||||
| @@ -52,7 +52,7 @@ void settingsLoad() { | |||||
| }); | }); | ||||
| json_error_t error; | json_error_t error; | ||||
| json_t *rootJ = json_loadf(file, 0, &error); | |||||
| json_t* rootJ = json_loadf(file, 0, &error); | |||||
| if (rootJ) { | if (rootJ) { | ||||
| settingsFromJson(rootJ); | settingsFromJson(rootJ); | ||||
| json_decref(rootJ); | json_decref(rootJ); | ||||
| @@ -60,10 +60,10 @@ void settingsLoad() { | |||||
| } | } | ||||
| void settingsSave() { | void settingsSave() { | ||||
| json_t *rootJ = settingsToJson(); | |||||
| json_t* rootJ = settingsToJson(); | |||||
| std::string filename = asset::user("VCV-Prototype.json"); | std::string filename = asset::user("VCV-Prototype.json"); | ||||
| FILE *file = std::fopen(filename.c_str(), "w"); | |||||
| FILE* file = std::fopen(filename.c_str(), "w"); | |||||
| if (file) { | if (file) { | ||||
| json_dumpf(rootJ, file, JSON_INDENT(2) | JSON_REAL_PRECISION(9)); | json_dumpf(rootJ, file, JSON_INDENT(2) | JSON_REAL_PRECISION(9)); | ||||
| std::fclose(file); | std::fclose(file); | ||||