Refactor: Remove some unnecessary uses of memcpy

- Also, remove unnecessary "static" in gnucash-style.c

The second one in guid.cpp is UB:

libgnucash/engine/guid.cpp:137:5: warning: undefined behavior, source object type 'const gnc::GUID' is not TriviallyCopyable [bugprone-undefined-memory-manipulation]
        memcpy (&target, &source, sizeof (GncGUID));
        ^
This commit is contained in:
Richard Cohen
2023-02-07 16:48:17 +00:00
parent 4a60e01fcd
commit 3abc9a5558
10 changed files with 18 additions and 24 deletions

View File

@@ -160,7 +160,7 @@ _retrieve_guid_ (gpointer pObject, gpointer pValue)
g_return_if_fail (pObject != NULL);
g_return_if_fail (pValue != NULL);
memcpy (pGuid, guid, sizeof (GncGUID));
*pGuid = *guid;
}
/* Special column table because we need to be able to access the table by

View File

@@ -649,7 +649,7 @@ _retrieve_guid_ (gpointer pObject, gpointer pValue)
g_return_if_fail (pObject != NULL);
g_return_if_fail (pValue != NULL);
memcpy (pGuid, guid, sizeof (GncGUID));
*pGuid = *guid;
}
// Table to retrieve just the guid