diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/EventMapper.cpp | 1 | ||||
| -rw-r--r-- | common/debug-channels.h | 2 | ||||
| -rw-r--r-- | common/debug.cpp | 8 | ||||
| -rw-r--r-- | common/debug.h | 1 | ||||
| -rw-r--r-- | common/json.cpp | 8 | 
5 files changed, 8 insertions, 12 deletions
diff --git a/common/EventMapper.cpp b/common/EventMapper.cpp index cf65946d50..f84d24b4d0 100644 --- a/common/EventMapper.cpp +++ b/common/EventMapper.cpp @@ -35,7 +35,6 @@ List<Event> DefaultEventMapper::mapEvent(const Event &ev, EventSource *source) {  	// of middle mouse button.  	const uint32 vkeybdTime = 1000; -	static bool vkeybd = false;  	static uint32 vkeybdThen = 0;  	if (ev.type == EVENT_MBUTTONDOWN) { diff --git a/common/debug-channels.h b/common/debug-channels.h index 1414a1053a..0fb8006803 100644 --- a/common/debug-channels.h +++ b/common/debug-channels.h @@ -117,7 +117,7 @@ public:  	/**  	 * Test whether the given debug channel is enabled.  	 */ -	bool isDebugChannelEnabled(uint32 channel); +	bool isDebugChannelEnabled(uint32 channel, bool enforce = false);  private:  	typedef HashMap<String, DebugChannel, IgnoreCase_Hash, IgnoreCase_EqualTo> DebugChannelMap; diff --git a/common/debug.cpp b/common/debug.cpp index c61fc63dea..5db8990db8 100644 --- a/common/debug.cpp +++ b/common/debug.cpp @@ -110,9 +110,9 @@ void DebugManager::disableAllDebugChannels() {  		disableDebugChannel(i->_value.name);  } -bool DebugManager::isDebugChannelEnabled(uint32 channel) { +bool DebugManager::isDebugChannelEnabled(uint32 channel, bool enforce) {  	// Debug level 11 turns on all special debug level messages -	if (gDebugLevel == 11) +	if (gDebugLevel == 11 && enforce == false)  		return true;  	else  		return (gDebugChannelsEnabled & channel) != 0; @@ -125,8 +125,8 @@ bool debugLevelSet(int level) {  }  bool debugChannelSet(int level, uint32 debugChannels) { -	if (gDebugLevel != 11) -		if (level > gDebugLevel || !(DebugMan.isDebugChannelEnabled(debugChannels))) +	if (gDebugLevel != 11 || level == -1) +		if ((level != -1 && level > gDebugLevel) || !(DebugMan.isDebugChannelEnabled(debugChannels, level == -1)))  			return false;  	return true; diff --git a/common/debug.h b/common/debug.h index 883a0bf29d..5ec37f2f1e 100644 --- a/common/debug.h +++ b/common/debug.h @@ -117,6 +117,7 @@ bool debugLevelSet(int level);  /**   * Returns true if the debug level and channel are active   * + * @param level debug level to check against. If set to -1, only channel check is active   * @see enableDebugChannel   */  bool debugChannelSet(int level, uint32 debugChannels); diff --git a/common/json.cpp b/common/json.cpp index 792d1967e9..c8caf01519 100644 --- a/common/json.cpp +++ b/common/json.cpp @@ -979,17 +979,13 @@ String JSONValue::stringifyImpl(size_t const indentDepth) const {  		if (isinf(_numberValue) || isnan(_numberValue))  			ret_string = "null";  		else { -			char str[80]; -			sprintf(str, "%g", _numberValue); -			ret_string = str; +			ret_string = String::format("%g", _numberValue);  		}  		break;  	}  	case JSONType_IntegerNumber: { -		char str[80]; -		sprintf(str, "%lld", _integerValue); -		ret_string = str; +		ret_string = String::format("%lld", _integerValue);  		break;  	}  | 
