Changeset 935315d


Ignore:
Timestamp:
May 22, 2017, 9:56:39 AM (8 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
13099105, eb182b0
Parents:
18c55e1
Message:

use unsigned int for loop index

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/gmp.c

    r18c55e1 r935315d  
    1010// Created On       : Tue Apr 19 08:55:51 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon May 22 08:55:09 2017
    13 // Update Count     : 536
     12// Last Modified On : Mon May 22 09:05:09 2017
     13// Update Count     : 538
    1414//
    1515
    1616#include <gmp>
    1717
    18 int main() {
     18int main( void ) {
    1919        sout | "constructors" | endl;
    2020        short int si = 3;
     
    7676        fn = 1; fn2 = fn1; fn1 = fn;                                            // 2nd case
    7777        sout | 1 | fn | endl;
    78         for ( int i = 2; i <= 200; i += 1 ) {
     78        for ( unsigned int i = 2; i <= 200; i += 1 ) {
    7979                fn = fn1 + fn2; fn2 = fn1; fn1 = fn;                    // general case
    8080                sout | i | fn | endl;
     
    8787        fact = 1;                                                                                       // 1st case
    8888        sout | (int)0 | fact | endl;
    89         for ( int i = 1; i <= 40; i += 1 ) {
     89        for ( unsigned int i = 1; i <= 40; i += 1 ) {
    9090                fact = fact * i;                                                                // general case
    9191                sout | i | fact | endl;
Note: See TracChangeset for help on using the changeset viewer.