diff options
author | Dennis Kasprzyk <onestone@compiz-fusion.org> | 2009-07-31 01:11:13 +0200 |
---|---|---|
committer | Dennis kasprzyk <onestone@compiz-fusion.org> | 2009-07-31 01:12:04 +0200 |
commit | b220ff78a833f6dbcdb866a17c0d9ce214f3cc5e (patch) | |
tree | 938816937266d8b3b3f3036780fabf5ee156caaf /include | |
parent | 0b59bca273529fa2849409c4a25fd225fa20b8de (diff) | |
download | zcomp-b220ff78a833f6dbcdb866a17c0d9ce214f3cc5e.tar.gz zcomp-b220ff78a833f6dbcdb866a17c0d9ce214f3cc5e.tar.bz2 |
Handle signed/unsigned correctly
Diffstat (limited to 'include')
-rw-r--r-- | include/core/pluginclasses.h | 8 | ||||
-rw-r--r-- | include/core/pluginclasshandler.h | 6 | ||||
-rw-r--r-- | include/core/screen.h | 4 | ||||
-rw-r--r-- | include/core/window.h | 4 |
4 files changed, 11 insertions, 11 deletions
diff --git a/include/core/pluginclasses.h b/include/core/pluginclasses.h index 351ac7c..0122a63 100644 --- a/include/core/pluginclasses.h +++ b/include/core/pluginclasses.h @@ -32,11 +32,11 @@ class PluginClassIndex { public: - PluginClassIndex () : index (-1), refCount (0), + PluginClassIndex () : index ((unsigned)~0), refCount (0), initiated (false), failed (false), pcFailed (false), pcIndex (0) {} - int index; + unsigned int index; int refCount; bool initiated; bool failed; @@ -56,8 +56,8 @@ class PluginClassStorage { std::vector<void *> pluginClasses; protected: - static int allocatePluginClassIndex (Indices& iList); - static void freePluginClassIndex (Indices& iList, int idx); + static unsigned int allocatePluginClassIndex (Indices& iList); + static void freePluginClassIndex (Indices& iList, unsigned int idx); }; #endif diff --git a/include/core/pluginclasshandler.h b/include/core/pluginclasshandler.h index 2b0e809..dde9b0d 100644 --- a/include/core/pluginclasshandler.h +++ b/include/core/pluginclasshandler.h @@ -77,14 +77,14 @@ PluginClassHandler<Tp,Tb,ABI>::PluginClassHandler (Tb *base) : if (!mIndex.initiated) { mIndex.index = Tb::allocPluginClassIndex (); - if (mIndex.index >= 0) + if (mIndex.index != (unsigned)~0) { mIndex.initiated = true; mIndex.failed = false; mIndex.pcIndex = pluginClassHandlerIndex; CompPrivate p; - p.val = mIndex.index; + p.uval = mIndex.index; if (!screen->hasValue (keyName ())) { @@ -149,7 +149,7 @@ PluginClassHandler<Tp,Tb,ABI>::get (Tb *base) if (screen->hasValue (keyName ())) { - mIndex.index = screen->getValue (keyName ()).val; + mIndex.index = screen->getValue (keyName ()).uval; mIndex.initiated = true; mIndex.failed = false; mIndex.pcIndex = pluginClassHandlerIndex; diff --git a/include/core/screen.h b/include/core/screen.h index f12259d..286b17e 100644 --- a/include/core/screen.h +++ b/include/core/screen.h @@ -318,8 +318,8 @@ class CompScreen : bool updateDefaultIcon (); - static int allocPluginClassIndex (); - static void freePluginClassIndex (int index); + static unsigned int allocPluginClassIndex (); + static void freePluginClassIndex (unsigned int index); WRAPABLE_HND (0, ScreenInterface, void, fileWatchAdded, CompFileWatch *) WRAPABLE_HND (1, ScreenInterface, void, fileWatchRemoved, CompFileWatch *) diff --git a/include/core/window.h b/include/core/window.h index 9d44717..d7d0387 100644 --- a/include/core/window.h +++ b/include/core/window.h @@ -476,8 +476,8 @@ class CompWindow : static unsigned int constrainWindowState (unsigned int state, unsigned int actions); - static int allocPluginClassIndex (); - static void freePluginClassIndex (int index); + static unsigned int allocPluginClassIndex (); + static void freePluginClassIndex (unsigned int index); WRAPABLE_HND (0, WindowInterface, void, getOutputExtents, CompWindowExtents&); |