mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 11:21:28 +00:00
Remove swaynag_clone and use memcpy
This commit is contained in:
parent
a7f7d4a488
commit
36fd84cc42
|
@ -8,10 +8,6 @@ struct swaynag_instance {
|
||||||
bool detailed;
|
bool detailed;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Copy all fields of one instance to another
|
|
||||||
void swaynag_clone(struct swaynag_instance *dest,
|
|
||||||
struct swaynag_instance *src);
|
|
||||||
|
|
||||||
// Spawn swaynag. If swaynag->detailed, then swaynag->fd[1] will left open
|
// Spawn swaynag. If swaynag->detailed, then swaynag->fd[1] will left open
|
||||||
// so it can be written to. Call swaynag_show when done writing. This will
|
// so it can be written to. Call swaynag_show when done writing. This will
|
||||||
// be automatically called by swaynag_log if the instance is not spawned and
|
// be automatically called by swaynag_log if the instance is not spawned and
|
||||||
|
|
|
@ -386,8 +386,9 @@ bool load_main_config(const char *file, bool is_active, bool validating) {
|
||||||
config->active = true;
|
config->active = true;
|
||||||
|
|
||||||
swaynag_kill(&old_config->swaynag_config_errors);
|
swaynag_kill(&old_config->swaynag_config_errors);
|
||||||
swaynag_clone(&config->swaynag_config_errors,
|
memcpy(&config->swaynag_config_errors,
|
||||||
&old_config->swaynag_config_errors);
|
&old_config->swaynag_config_errors,
|
||||||
|
sizeof(struct swaynag_instance));
|
||||||
|
|
||||||
create_default_output_configs();
|
create_default_output_configs();
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,15 +8,6 @@
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
#include "sway/swaynag.h"
|
#include "sway/swaynag.h"
|
||||||
|
|
||||||
void swaynag_clone(struct swaynag_instance *dest,
|
|
||||||
struct swaynag_instance *src) {
|
|
||||||
dest->args = src->args;
|
|
||||||
dest->pid = src->pid;
|
|
||||||
dest->fd[0] = src->fd[0];
|
|
||||||
dest->fd[1] = src->fd[1];
|
|
||||||
dest->detailed = src->detailed;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool swaynag_spawn(const char *swaynag_command,
|
bool swaynag_spawn(const char *swaynag_command,
|
||||||
struct swaynag_instance *swaynag) {
|
struct swaynag_instance *swaynag) {
|
||||||
if (swaynag->detailed) {
|
if (swaynag->detailed) {
|
||||||
|
|
Loading…
Reference in a new issue