clocksource: revert: use init_timer_deferrable for clocksource_watchdog

Revert

commit 1077f5a917b7c630231037826b344b2f7f5b903f
Author: Parag Warudkar <parag.warudkar@gmail.com>
Date:   Wed Jan 30 13:30:01 2008 +0100

    clocksource.c: use init_timer_deferrable for clocksource_watchdog

    clocksource_watchdog can use a deferrable timer - reduces wakeups from
    idle per second.

The watchdog timer needs to run with the specified interval. Otherwise
it will miss the possible wrap of the watchdog clocksource.

Signed-off-by: Thomas Gleixner <00e4cf8f46a57000a44449bf9dd8cbbcc209fd2a@linutronix.de>
Cc: 4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org

--- kernel/time/clocksource.c
+++ kernel/time/clocksource.c
@@ -174,7 +174,7 @@
 			if (watchdog)
 				del_timer(&watchdog_timer);
 			watchdog = cs;
-			init_timer_deferrable(&watchdog_timer);
+			init_timer(&watchdog_timer);
 			watchdog_timer.function = clocksource_watchdog;

 			/* Reset watchdog cycles */


time: Workaround gcc loop optimization that causes 64bit div errors

Early 4.3 versions of gcc apparently aggressively optimize the raw
time accumulation loop, replacing it with a divide.

On 32bit systems, this causes the following link errors:
	undefined reference to `__umoddi3'
	undefined reference to `__udivdi3'

The gcc issue has been fixed in 4.4 and greater.

This patch replaces the accumulation loop with a do_div, as suggested
by Linus.

Signed-off-by: John Stultz <2dbbc9a029f6af74f2c2786ce8fa25d932fcaf8c@us.ibm.com>
CC: Jason Wessel <3f19c87103ac4cd0301ffd05a2421b687c7b3c77@windriver.com>
CC: Larry Finger <ed0f1d78b8c21b2970494a178da4bdfa8beba2a7@lwfinger.net>
CC: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>
CC: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>

--- kernel/time/timekeeping.c
+++ kernel/time/timekeeping.c
@@ -710,9 +710,10 @@
 	/* Accumulate raw time */
 	raw_nsecs = timekeeper.raw_interval << shift;
 	raw_nsecs += raw_time.tv_nsec;
-	while (raw_nsecs >= NSEC_PER_SEC) {
-		raw_nsecs -= NSEC_PER_SEC;
-		raw_time.tv_sec++;
+	if (raw_nsecs >= NSEC_PER_SEC) {
+		u64 raw_secs = raw_nsecs;
+		raw_nsecs = do_div(raw_secs, NSEC_PER_SEC);
+		raw_time.tv_sec += raw_secs;
 	}
 	raw_time.tv_nsec = raw_nsecs;


comments and lose default args to ObjectVariantMapper::StructureFieldInfo::CTOR

--- Library/Sources/Stroika/Foundation/DataExchange/ObjectVariantMapper.h
+++ Library/Sources/Stroika/Foundation/DataExchange/ObjectVariantMapper.h
@@ -376,13 +376,14 @@

             /**
+             *  This is just for use the with the ObjectVariantMapper::AddClass<> (and related) methods, to describe a user-defined type (CLASS).
              */
             struct  ObjectVariantMapper::StructureFieldInfo {
                 size_t      fOffset;
                 type_index  fTypeInfo;
                 String      fSerializedFieldName;

-                StructureFieldInfo (size_t fieldOffset = 0, type_index typeInfo = typeid(void), const String& serializedFieldName = String ());
+                StructureFieldInfo (size_t fieldOffset, type_index typeInfo, const String& serializedFieldName);
             };


runtests.c: Fix memleaks

runtests.c: Fix memleaks

--- expat/tests/runtests.c
+++ expat/tests/runtests.c
@@ -2168,6 +2168,8 @@
         if (status.parsing != XML_FINISHED)
             fail("Ext Parsing status not FINISHED");
     }
+
+    XML_ParserFree(ext_parser);
     return XML_STATUS_OK;
 }

@@ -2239,6 +2241,8 @@
         fail(fault->fail_text);
     if (XML_GetErrorCode(ext_parser) != fault->error)
         xml_failure(ext_parser);
+
+    XML_ParserFree(ext_parser);
     return XML_STATUS_ERROR;
 }


Fixed typo in documentation comment.

Fixed typo in documentation comment.

--- GG/Exception.h
+++ GG/Exception.h
@@ -71,7 +71,7 @@
 };

 /** Declares a GG exception class.  This should be used to declare GG
-    exceptions at global scope. */
+    exceptions at namespace scope. */
 #define GG_EXCEPTION( name )                                            \
     class GG_API name : public ExceptionBase                            \
     {                                                                   \


Increase test coverage of XML_SetEncoding()

--- expat/tests/runtests.c
+++ expat/tests/runtests.c
@@ -1652,6 +1652,30 @@
     XML_SetExternalEntityRefHandler(parser, external_entity_resetter);
     if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) == XML_STATUS_ERROR)
         xml_failure(parser);
+}
+END_TEST
+
+/* Test setting an explicit encoding */
+START_TEST(test_explicit_encoding)
+{
+    const char *text1 = "<doc>Hello ";
+    const char *text2 = " World</doc>";
+
+    /* First say we are UTF-8 */
+    if (XML_SetEncoding(parser, "utf-8") != XML_STATUS_OK)
+        fail("Failed to set explicit encoding");
+    if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+                                XML_FALSE) == XML_STATUS_ERROR)
+        xml_failure(parser);
+    /* Try to switch encodings mid-parse */
+    if (XML_SetEncoding(parser, "us-ascii") != XML_STATUS_ERROR)
+        fail("Allowed encoding change");
+    if (_XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
+                                XML_TRUE) == XML_STATUS_ERROR)
+        xml_failure(parser);
+    /* Try now the parse is over */
+    if (XML_SetEncoding(parser, NULL) != XML_STATUS_OK)
+        fail("Failed to unset encoding");
 }
 END_TEST

@@ -2596,6 +2620,7 @@
     tcase_add_test(tc_basic, test_attributes);
     tcase_add_test(tc_basic, test_reset_in_entity);
     tcase_add_test(tc_basic, test_subordinate_reset);
+    tcase_add_test(tc_basic, test_explicit_encoding);

     suite_add_tcase(s, tc_namespace);
     tcase_add_checked_fixture(tc_namespace,


[Fixed] Squad Leader command Retreat won't cost ham for group members
anymore. Mantis #0004305

Change-Id: I6293db339af5730337431c98a9097b25d747f0a8

--- MMOCoreORB/src/server/zone/objects/creature/commands/RetreatCommand.h
+++ MMOCoreORB/src/server/zone/objects/creature/commands/RetreatCommand.h
@@ -151,13 +151,6 @@
 		if (groupRunMod > 100.0f)
 			groupRunMod = 100.0f;

-		int newHamCost = (int) (100.0f * (1.0f - (groupRunMod / 100.0f)));
-
-		if (!inflictHAM(player, newHamCost, newHamCost, newHamCost)) {
-			player->sendSystemMessage("@combat_effects:burst_run_wait"); //You are too tired to Burst Run.
-			return;
-		}
-
 		StringIdChatParameter startStringId("cbt_spam", "burstrun_start_single");
 		StringIdChatParameter endStringId("cbt_spam", "burstrun_stop_single");


Test substituted public entity with long name against failing realloc

--- expat/tests/runtests.c
+++ expat/tests/runtests.c
@@ -5887,7 +5887,33 @@
                        const XML_Char *systemId,
                        const XML_Char *publicId)
 {
-    const char *text1 =
+    const char *text1 = (const char *)XML_GetUserData(parser);
+    const char *text2 = "<!ATTLIST doc a CDATA 'value'>";
+    const char *text;
+    XML_Parser ext_parser;
+    int parse_res;
+
+    ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
+    if (ext_parser == NULL)
+        return XML_STATUS_ERROR;
+    if (systemId != NULL && !strcmp(systemId, "http://example.org/")) {
+        text = text1;
+    }
+    else if (publicId != NULL && !strcmp(publicId, "foo")) {
+        text = text2;
+    }
+    parse_res = _XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
+                                   XML_TRUE);
+    XML_ParserFree(ext_parser);
+    return parse_res;
+}
+
+START_TEST(test_alloc_public_entity_value)
+{
+    const char *text =
+        "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+        "<doc></doc>\n";
+    char dtd_text[] =
         "<!ELEMENT doc EMPTY>\n"
         "<!ENTITY % e1 PUBLIC 'foo' 'bar.ent'>\n"
         "<!ENTITY % "
@@ -5910,31 +5936,6 @@
         "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
         " '%e1;'>\n"
         "%e1;\n";
-    const char *text2 = "<!ATTLIST doc a CDATA 'value'>";
-    const char *text;
-    XML_Parser ext_parser;
-    int parse_res;
-
-    ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);
-    if (ext_parser == NULL)
-        return XML_STATUS_ERROR;
-    if (systemId != NULL && !strcmp(systemId, "http://example.org/")) {
-        text = text1;
-    }
-    else if (publicId != NULL && !strcmp(publicId, "foo")) {
-        text = text2;
-    }
-    parse_res = _XML_Parse_SINGLE_BYTES(ext_parser, text, strlen(text),
-                                   XML_TRUE);
-    XML_ParserFree(ext_parser);
-    return parse_res;
-}
-
-START_TEST(test_alloc_public_entity_value)
-{
-    const char *text =
-        "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
-        "<doc></doc>\n";
     int i;
 #define MAX_ALLOC_COUNT 25
     int repeat = 0;
@@ -5952,6 +5953,7 @@
         }
         allocation_count = i;
         dummy_handler_flags = 0;
+        XML_SetUserData(parser, dtd_text);
         XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
         XML_SetExternalEntityRefHandler(parser, external_entity_public);
         /* Provoke a particular code path */
@@ -5969,6 +5971,69 @@
         fail("Entity declaration handler not called");
 }
 #undef MAX_ALLOC_COUNT
+END_TEST
+
+START_TEST(test_alloc_realloc_subst_public_entity_value)
+{
+    const char *text =
+        "<!DOCTYPE doc SYSTEM 'http://example.org/'>\n"
+        "<doc></doc>\n";
+    char dtd_text[] =
+        "<!ELEMENT doc EMPTY>\n"
+        "<!ENTITY % "
+        /* Each line is 64 characters */
+        "ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        " PUBLIC 'foo' 'bar.ent'>\n"
+        "%ThisIsAStupidlyLongParameterNameIntendedToTriggerPoolGrowth12345"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP"
+        "ABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOPABCDEFGHIJKLMNOP;";
+    int i;
+#define MAX_REALLOC_COUNT 10
+
+    for (i = 0; i < MAX_REALLOC_COUNT; i++) {
+        reallocation_count = i;
+        XML_SetUserData(parser, dtd_text);
+        XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
+        XML_SetExternalEntityRefHandler(parser, external_entity_public);
+        if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+                                    XML_TRUE) != XML_STATUS_ERROR)
+            break;
+        XML_ParserReset(parser, NULL);
+    }
+    if (i == 0)
+        fail("Parsing worked despite failing reallocation");
+    if (i == MAX_REALLOC_COUNT)
+        fail("Parsing failed at max reallocation count");
+}
+#undef MAX_REALLOC_COUNT
 END_TEST

 START_TEST(test_alloc_parse_public_doctype)
@@ -7342,6 +7407,7 @@
     tcase_add_test(tc_alloc, test_alloc_ext_entity_realloc_buffer);
     tcase_add_test(tc_alloc, test_alloc_realloc_many_attributes);
     tcase_add_test(tc_alloc, test_alloc_public_entity_value);
+    tcase_add_test(tc_alloc, test_alloc_realloc_subst_public_entity_value);
     tcase_add_test(tc_alloc, test_alloc_parse_public_doctype);
     tcase_add_test(tc_alloc, test_alloc_parse_public_doctype_long_name);
     tcase_add_test(tc_alloc, test_alloc_set_foreign_dtd);


examples/regexp-ext.c: Add an unused submatch variable.

--- examples/regexp-ext.c
+++ examples/regexp-ext.c
@@ -19,8 +19,10 @@
     eval_and_report(interp, "regexp {***++} foo");
     eval_and_report(interp, "regexp bar foo");
     eval_and_report(interp, "regexp foo foo");
-    eval_and_report(interp, "regexp (a+)(b+) aaabb match sub1 sub2 s");
-    picolEval(interp,
-              "puts \"     match: $match\nsubmatches: [list $sub1 $sub2]\"");
+    eval_and_report(interp, "regexp (a+)(b+) aaabb match sub1 sub2 sub3");
+    picolEval(
+        interp,
+        "puts \"     match: $match\nsubmatches: [list $sub1 $sub2 $sub3]\""
+    );
     return 0;
 }