platform: don't use static temporary cache_id

This only saves some typing at a few places. In general, avoid
static variables, so drop it in favor of a stack-allocated
cache_id.
This commit is contained in:
Thomas Haller
2016-12-01 10:56:09 +01:00
parent fde46d7e65
commit ce2d1f062b
3 changed files with 16 additions and 12 deletions

View File

@@ -1024,8 +1024,6 @@ nmp_cache_id_destroy (NMPCacheId *id)
/*****************************************************************************/
NMPCacheId _nmp_cache_id_static;
static void
_nmp_cache_id_init (NMPCacheId *id, NMPCacheIdType id_type)
{
@@ -1364,7 +1362,9 @@ nmp_cache_link_connected_needs_toggle (const NMPCache *cache, const NMPObject *m
&& potential_slave->link.connected) {
is_lower_up = TRUE;
} else {
links = (const NMPlatformLink *const *) nmp_cache_lookup_multi (cache, nmp_cache_id_init_object_type (NMP_CACHE_ID_STATIC, NMP_OBJECT_TYPE_LINK, FALSE), &len);
NMPCacheId cache_id;
links = (const NMPlatformLink *const *) nmp_cache_lookup_multi (cache, nmp_cache_id_init_object_type (&cache_id, NMP_OBJECT_TYPE_LINK, FALSE), &len);
for (i = 0; i < len; i++) {
const NMPlatformLink *link = links[i];
const NMPObject *obj = NMP_OBJECT_UP_CAST ((NMPlatformObject *) link);