mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user