diff options
author | Daniel Lange <DLange@git.local> | 2020-12-07 10:26:02 +0100 |
---|---|---|
committer | Daniel Lange <DLange@git.local> | 2020-12-07 10:26:02 +0100 |
commit | d67ee86091f9e07f8d85c1fb77c7c58989e676bb (patch) | |
tree | 900f5e62bfd8e8c082be75a94f5348dea819beba /Object.c | |
parent | 3cbc50cde37fee19ce98ee8260b0a6095b829c4c (diff) | |
parent | 65357c8c46154de4e4eca14075bfe5523bb5fc14 (diff) | |
download | debian_htop-d67ee86091f9e07f8d85c1fb77c7c58989e676bb.tar.gz debian_htop-d67ee86091f9e07f8d85c1fb77c7c58989e676bb.tar.bz2 debian_htop-d67ee86091f9e07f8d85c1fb77c7c58989e676bb.zip |
Update upstream source from tag 'upstream/3.0.3'
Update to upstream version '3.0.3'
with Debian dir 8a3a733dc80e45b1cde220f88fcfd815869742f0
Diffstat (limited to 'Object.c')
-rw-r--r-- | Object.c | 22 |
1 files changed, 13 insertions, 9 deletions
@@ -2,28 +2,32 @@ htop - Object.c (C) 2004-2012 Hisham H. Muhammad (C) 2020 Red Hat, Inc. All Rights Reserved. -Released under the GNU GPL, see the COPYING file +Released under the GNU GPLv2, see the COPYING file in the source distribution for its full text. */ #include "Object.h" -ObjectClass Object_class = { +#include <stddef.h> + + +const ObjectClass Object_class = { .extends = NULL }; -#ifdef DEBUG +#ifndef NDEBUG -bool Object_isA(Object* o, const ObjectClass* klass) { +bool Object_isA(const Object* o, const ObjectClass* klass) { if (!o) return false; - const ObjectClass* type = o->klass; - while (type) { - if (type == klass) + + for (const ObjectClass* type = o->klass; type; type = type->extends) { + if (type == klass) { return true; - type = type->extends; + } } + return false; } -#endif +#endif /* NDEBUG */ |