Bug 1404147 Make string index and lengths unsigned to resolve signed/unsigned comparison warning r?jimm draft
authorTom Ritter <tom@mozilla.com>
Thu, 28 Sep 2017 18:01:58 -0500
changeset 674381 135c068cf7b7f1076bf2ca5350ab32e3024fed2b
parent 674380 a57367f1e2b2326ae0cb9288377c9aeffefb3421
child 674382 8622fd363f62dd4b0964ca6b45fd2b347eaf25ea
child 674602 2bb9a06bb7658c4aa30558e52571e74cce3b6071
push id82814
push userbmo:tom@mozilla.com
push dateTue, 03 Oct 2017 17:51:18 +0000
reviewersjimm
bugs1404147
milestone58.0a1
Bug 1404147 Make string index and lengths unsigned to resolve signed/unsigned comparison warning r?jimm MozReview-Commit-ID: Cpo5Gd1puzd
widget/windows/TSFTextStore.cpp
widget/windows/TSFTextStore.h
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -4730,18 +4730,18 @@ TSFTextStore::RecordCompositionStartActi
   }
 
   return RecordCompositionStartAction(aComposition, start, length,
                                       aPreserveSelection);
 }
 
 HRESULT
 TSFTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition,
-                                           LONG aStart,
-                                           LONG aLength,
+                                           ULONG aStart,
+                                           ULONG aLength,
                                            bool aPreserveSelection)
 {
   MOZ_LOG(sTextStoreLog, LogLevel::Debug,
     ("0x%p   TSFTextStore::RecordCompositionStartAction("
      "aComposition=0x%p, aStart=%d, aLength=%d, aPreserveSelection=%s), "
      "mComposition.mView=0x%p",
      this, aComposition, aStart, aLength, GetBoolName(aPreserveSelection),
      mComposition.mView.get()));
--- a/widget/windows/TSFTextStore.h
+++ b/widget/windows/TSFTextStore.h
@@ -309,18 +309,18 @@ protected:
                               ITfRange* aNewRange);
 
   // Following methods record composing action(s) to mPendingActions.
   // They will be flushed FlushPendingActions().
   HRESULT  RecordCompositionStartAction(ITfCompositionView* aCompositionView,
                                         ITfRange* aRange,
                                         bool aPreserveSelection);
   HRESULT  RecordCompositionStartAction(ITfCompositionView* aComposition,
-                                        LONG aStart,
-                                        LONG aLength,
+                                        ULONG aStart,
+                                        ULONG aLength,
                                         bool aPreserveSelection);
   HRESULT  RecordCompositionUpdateAction();
   HRESULT  RecordCompositionEndAction();
 
   // DispatchEvent() dispatches the event and if it may not be handled
   // synchronously, this makes the instance not notify TSF of pending
   // notifications until next notification from content.
   void     DispatchEvent(WidgetGUIEvent& aEvent);
@@ -687,17 +687,17 @@ protected:
    * composition immediately before (e.g., see InsertTextAtSelectionInternal()).
    *
    * @param aStart              The inserted offset you expected.
    * @param aLength             The inserted text length you expected.
    * @return                    true if the last pending actions are
    *                            COMPOSITION_START and COMPOSITION_END and
    *                            aStart and aLength match their information.
    */
-  bool WasTextInsertedWithoutCompositionAt(LONG aStart, LONG aLength) const
+  bool WasTextInsertedWithoutCompositionAt(ULONG aStart, ULONG aLength) const
   {
     if (mPendingActions.Length() < 2) {
       return false;
     }
     const PendingAction& pendingLastAction = mPendingActions.LastElement();
     if (pendingLastAction.mType != PendingAction::COMPOSITION_END ||
         pendingLastAction.mData.Length() != aLength) {
       return false;