Bug 1409619 Resolve signed/unsigned comparison warning by fixing function definitions to be signed in widget/windows/TSFTextStore r?jimm draft
authorTom Ritter <tom@mozilla.com>
Tue, 17 Oct 2017 23:37:31 -0500 (2017-10-18)
changeset 682122 b5a8dac593e80b7bfba72dde81194e3f24fad118
parent 681987 b3a2f65375f3788659c0964aff16a1de482035b1
child 682123 d3bc016c93cad9670be7b8f0f4e8855350464fc7
child 682129 e4206c2420ccbc45b7710a715b2280fabcf73484
push id85006
push userbmo:tom@mozilla.com
push dateWed, 18 Oct 2017 04:46:53 +0000 (2017-10-18)
reviewersjimm
bugs1409619
milestone58.0a1
Bug 1409619 Resolve signed/unsigned comparison warning by fixing function definitions to be signed in widget/windows/TSFTextStore r?jimm The functions changed are given signed arguments (that are converted to unsigned). Changing them to signed resolves the warnings and preserves the original values. MozReview-Commit-ID: BxIAECFiuQR
widget/windows/TSFTextStore.cpp
widget/windows/TSFTextStore.h
old mode 100644
new mode 100755
--- a/widget/windows/TSFTextStore.cpp
+++ b/widget/windows/TSFTextStore.cpp
@@ -4763,18 +4763,18 @@ TSFTextStore::RecordCompositionStartActi
   }
 
   return RecordCompositionStartAction(aComposition, start, length,
                                       aPreserveSelection);
 }
 
 HRESULT
 TSFTextStore::RecordCompositionStartAction(ITfCompositionView* aComposition,
-                                           ULONG aStart,
-                                           ULONG aLength,
+                                           LONG aStart,
+                                           LONG 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()));
old mode 100644
new mode 100755
--- a/widget/windows/TSFTextStore.h
+++ b/widget/windows/TSFTextStore.h
@@ -317,18 +317,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,
-                                        ULONG aStart,
-                                        ULONG aLength,
+                                        LONG aStart,
+                                        LONG 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);
@@ -695,24 +695,24 @@ 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(ULONG aStart, ULONG aLength) const
+  bool WasTextInsertedWithoutCompositionAt(LONG aStart, LONG aLength) const
   {
     if (mPendingActions.Length() < 2) {
       return false;
     }
     const PendingAction& pendingLastAction = mPendingActions.LastElement();
     if (pendingLastAction.mType != PendingAction::COMPOSITION_END ||
-        pendingLastAction.mData.Length() != aLength) {
+        pendingLastAction.mData.Length() != ULONG(aLength)) {
       return false;
     }
     const PendingAction& pendingPreLastAction =
       mPendingActions[mPendingActions.Length() - 2];
     return pendingPreLastAction.mType == PendingAction::COMPOSITION_START &&
            pendingPreLastAction.mSelectionStart == aStart;
   }