Your loop:<p><pre><code>    void TestSigned(int min, int max, int step) {
      for (int i = max; i &gt;= min; i -= step) F(i);
    }
</code></pre>
Becomes this with unsigned:<p><pre><code>    void TestUnsigned(unsigned min, unsigned max, unsigned step) {
      while (true) {
        F(max);
        if (max &lt; min + step) break;
        max -= step;
      }
    }
</code></pre>
Now if I want to transform my loop to operate on pointers or iterators, the transformation is trivial:<p><pre><code>    void TestUnsigned(unsigned *min, unsigned *max, unsigned step) {
      while (true) {
        F(*max);
        if (max &lt; min + step) break;
        max -= step;
      }
    }
</code></pre>
Quick: Do the same for yours.