ConfigData: add constructors/destructors
This commit is contained in:
@@ -106,13 +106,12 @@ main(int argc, char **argv)
|
||||
/* do it */
|
||||
|
||||
const struct config_param *path = config_get_param(CONF_DB_FILE);
|
||||
struct config_param *param = config_new_param("database", path->line);
|
||||
config_param param("database", path->line);
|
||||
if (path != nullptr)
|
||||
config_add_block_param(param, "path", path->value, path->line);
|
||||
config_add_block_param(¶m, "path", path->value,
|
||||
path->line);
|
||||
|
||||
Database *db = plugin->create(param, &error);
|
||||
|
||||
config_param_free(param);
|
||||
Database *db = plugin->create(¶m, &error);
|
||||
|
||||
if (db == nullptr) {
|
||||
cerr << error->message << endl;
|
||||
|
||||
@@ -49,7 +49,6 @@ int main(int argc, char **argv)
|
||||
const char *encoder_name;
|
||||
const struct encoder_plugin *plugin;
|
||||
struct encoder *encoder;
|
||||
struct config_param *param;
|
||||
static char buffer[32768];
|
||||
|
||||
/* parse command line */
|
||||
@@ -74,10 +73,10 @@ int main(int argc, char **argv)
|
||||
return 1;
|
||||
}
|
||||
|
||||
param = config_new_param(NULL, -1);
|
||||
config_add_block_param(param, "quality", "5.0", -1);
|
||||
config_param param;
|
||||
config_add_block_param(¶m, "quality", "5.0", -1);
|
||||
|
||||
encoder = encoder_init(plugin, param, &error);
|
||||
encoder = encoder_init(plugin, ¶m, &error);
|
||||
if (encoder == NULL) {
|
||||
g_printerr("Failed to initialize encoder: %s\n",
|
||||
error->message);
|
||||
|
||||
@@ -53,10 +53,10 @@ main(G_GNUC_UNUSED int argc, G_GNUC_UNUSED char **argv)
|
||||
const struct encoder_plugin *plugin = encoder_plugin_get("vorbis");
|
||||
assert(plugin != NULL);
|
||||
|
||||
struct config_param *param = config_new_param(NULL, -1);
|
||||
config_add_block_param(param, "quality", "5.0", -1);
|
||||
config_param param;
|
||||
config_add_block_param(¶m, "quality", "5.0", -1);
|
||||
|
||||
struct encoder *encoder = encoder_init(plugin, param, NULL);
|
||||
struct encoder *encoder = encoder_init(plugin, ¶m, NULL);
|
||||
assert(encoder != NULL);
|
||||
|
||||
/* open the encoder */
|
||||
|
||||
Reference in New Issue
Block a user