Changeset 34815

Show
Ignore:
Timestamp:
08/08/09 00:22:24 (4 years ago)
Author:
saturday06
Message:

uc???????

Location:
lang/objective-cplusplus/i3/trunk
Files:
26 modified

Legend:

Unmodified
Added
Removed
  • lang/objective-cplusplus/i3/trunk/am/i3.am

    r34376 r34815  
    4343 
    4444else 
    45 i3_CXXFLAGS += #-fno-rtti 
     45i3_CXXFLAGS += -fno-rtti 
    4646i3_LDFLAGS  += 
    4747i3_LDADD    += 
  • lang/objective-cplusplus/i3/trunk/am/mil_test.am

    r34812 r34815  
    2020 
    2121# src/mil/src/Test11.cpp 
    22 # src/mil/src/BoostTestDummyLib.cpp 
    2322 
    2423mil_test_CXXFLAGS = ${i3_CXXFLAGS} \ 
     
    4544 
    4645if WITH_CYGWIN 
    47 # for cygwin boost/test/included/unit_test.hpp 
    48 mil_test_CXXFLAGS += -DBOOST_DISABLE_WIN32 
     46mil_test_CXXFLAGS += #-DBOOST_DISABLE_WIN32 
    4947mil_test_LDFLAGS  += -Wl,--enable-auto-import 
    5048endif 
  • lang/objective-cplusplus/i3/trunk/configure.ac

    r34792 r34815  
    33 
    44AC_PREREQ(2.60) 
     5 
    56AC_INIT([i3], [0.1alpha], [dyob@lunaport.net]) 
     7#AC_INIT([i3], m4_esyscmd([./version.sh | tr -d '\n']), [dyob@lunaport.net]) 
    68 
    79CFLAGS_before_configure="$CFLAGS" 
     
    1012 
    1113AC_CONFIG_AUX_DIR([build-aux]) 
    12 #AM_INIT_AUTOMAKE([gnu no-define check-news std-options tar-pax filename-length-max=99]) 
     14#AM_INIT_AUTOMAKE([gnu no-define check-news std-options filename-length-max=99]) 
    1315AM_INIT_AUTOMAKE([gnu no-define check-news std-options]) 
    1416AC_CONFIG_SRCDIR([src/Main.cpp]) 
     
    230232AC_SUBST(CXXFLAGS_NO_LANG) 
    231233 
     234# -Wno-missing-field-initializers 
     235AC_MSG_CHECKING([for -Wno-missing-field-initializers]) 
     236CXXFLAGS_ORIG="$CXXFLAGS -Wno-missing-field-initializers" 
     237AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [AC_MSG_RESULT([yes])], [AC_MSG_RESULT([no])]) 
     238CXXFLAGS="$CXXFLAGS_ORIG" 
     239 
    232240# 
    233241# precompiled headers 
     
    235243 
    236244use_gch=no 
    237 if test "$enable_debug" = "yes"; then 
    238     if test "$GXX" = "yes"; then 
     245if test "$GXX" = "yes"; then 
     246    if test "$enable_debug" = "yes"; then 
    239247        AC_MSG_CHECKING([for precompiled headers]) 
    240248        CXXFLAGS_ORIG="$CXXFLAGS" 
  • lang/objective-cplusplus/i3/trunk/src/Test3.cpp

    r34500 r34815  
    2525        keybd_event( 'F', 0, KEYEVENTF_KEYUP, 0); 
    2626    } 
    27         sleep(1); 
     27    sleep(1); 
    2828 
    29         mil::ExitEvent e; 
    30         mediator.getInputWindow().post(e, *this); 
    31         mediator.getDelegate().post(e, *this); 
    32         destroy(); 
     29    mil::ExitEvent e; 
     30    mediator.getInputWindow().post(e, *this); 
     31    mediator.getDelegate().post(e, *this); 
     32    destroy(); 
    3333} 
    3434} 
     
    4343    int argc = 0; 
    4444    char** argv = NULL; 
    45      
     45 
    4646    QT_CHECK_EQUAL(init_os_global_data(argc, argv), 0); 
    4747    QT_CHECK_EQUAL(init_gui_global_data(argc, argv), 0); 
  • lang/objective-cplusplus/i3/trunk/src/TestInputWindow1.h

    r34500 r34815  
    1515    void run(); 
    1616    template <typename T> 
    17         void execute(T& event) {} 
     17    void execute(T& event) {} 
    1818}; 
    1919 
     
    2323    DummyModule(Mediator& mediator) : mediator(mediator) {} 
    2424    void createGui() {} 
    25         void run() {} 
     25    void run() {} 
    2626    template <typename T> 
    2727    void execute(T& event) {} 
  • lang/objective-cplusplus/i3/trunk/src/gui-windows/GuiTest1.cpp

    r34612 r34815  
    3232    init_os_global_data(argc, argv); 
    3333    init_gui_global_data(argc, argv); 
    34      
     34 
    3535    basic_string<TCHAR> got; 
    3636#ifndef __CYGWIN__ 
  • lang/objective-cplusplus/i3/trunk/src/gui-windows/InputWindowPlatform.cpp

    r34769 r34815  
    135135        return HTCAPTION; 
    136136    } 
    137      
     137 
    138138    if (p.x >= layout.width - layout.margin_right - (layout.width - layout.nc_width) / 2) { 
    139139        return HTRIGHT; 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Atomic.h

    r34723 r34815  
    116116    atomic() { 
    117117        BOOST_STATIC_ASSERT(sizeof(T) <= sizeof(void*)); 
    118          
     118 
    119119        store(T()); 
    120120    } 
     
    148148        return result2; 
    149149    } 
    150      
     150 
    151151    T fetch_and_add(T val) { 
    152152        LONG* arg1 = memcpy_cast<LONG*>(&t); 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/DoubleBuffer.h

    r34500 r34815  
    88    T buffer[2]; 
    99    int current_cache; 
    10         atomic<boost::uint32_t> status; //  0-15: newer buffer   0,1=offset 
    11                              // 16-32: reading buffer 0=idle 1=offset0, 2=offset1 
     10    atomic<boost::uint32_t> status; //  0-15: newer buffer   0,1=offset 
     11    // 16-32: reading buffer 0=idle 1=offset0, 2=offset1 
    1212 
    1313    DoubleBuffer() : current_cache(0), status(0) { 
     
    1515 
    1616    void write(T data) { 
    17                 using namespace boost; 
     17        using namespace boost; 
    1818        // �ǂݍ��ݒ��̃o�b�t�@���ŐV�ł͂Ȃ��� 
    1919        uint16_t c_newer = current_cache; 
     
    3535        current_cache ^= 1; 
    3636    } 
    37      
     37 
    3838    bool read(T& result) { 
    3939        int current = 0; 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Memory.h

    r34812 r34815  
    6161        BYTES = BYTES_, 
    6262    }; 
    63      
     63 
    6464    typedef SFINAE_CONDITION IsReturnMemoryEvent; 
    6565 
     
    8383} 
    8484 
    85 #define MIL_PRODUCER_MALLOCasdf 
    86 #ifdef MIL_PRODUCER_MALLOC 
     85#define MIL_MALLOC_PRODUCERoo 
     86#ifdef MIL_MALLOC_PRODUCER 
    8787 
    8888class Producer { 
     
    116116}; 
    117117 
    118 #elif MIL_PRODUCER_TBB 
     118#elif MIL_TBB_PRODUCER 
    119119#else 
    120120 
    121 #define MIL_DEBUG_PRODUCER 
     121#define MIL_DEBUG_PRODUCERiii 
    122122 
    123123class Producer { 
     
    153153    } 
    154154#else 
    155     { 
    156         int blocks = Bytes2Blocks<BYTES>::value; 
    157         if (blocks > MALLOC_BLOCKS_THESHOLD) { 
    158             return ::malloc(BYTES); 
    159         } else if (blocks == 1) { 
    160             return p.malloc(); 
    161         } else { 
    162             return p.ordered_malloc(blocks); 
    163         } 
    164     } 
     155{ 
     156    int blocks = Bytes2Blocks<BYTES>::value; 
     157    if (blocks > MALLOC_BLOCKS_THESHOLD) { 
     158        return ::malloc(BYTES); 
     159    } else if (blocks == 1) { 
     160        return p.malloc(); 
     161    } else { 
     162        return p.ordered_malloc(blocks); 
     163    } 
     164} 
    165165#endif 
    166166 
     
    172172        if (d->os_thread_id != GetCurrentThreadId()) { 
    173173            halt << "d->os_thread_id != GetCurrentThreadId(), " 
    174                  << d->os_thread_id << " != " << GetCurrentThreadId(); 
     174            << d->os_thread_id << " != " << GetCurrentThreadId(); 
    175175        } 
    176176        if (d->mil_thread_id != thread_id) { 
    177177            halt << "d->mil_thread_id == thread_id, " 
    178                  << d->mil_thread_id << " != " << thread_id; 
     178            << d->mil_thread_id << " != " << thread_id; 
    179179        } 
    180180        if (d->blocks != blocks) { 
    181181            halt << "d->blocks != blocks, " 
    182                  << d->blocks << " != " << blocks; 
     182            << d->blocks << " != " << blocks; 
    183183        } 
    184184        ::free((void*)memory); 
    185185    } 
    186186#else 
    187     { 
    188         if (blocks > (size_t)MALLOC_BLOCKS_THESHOLD) { 
    189             ::free((void*)memory); 
    190         } else if (blocks == 1) { 
    191             p.free(memory); 
    192         } else { 
    193             p.free(memory, blocks); 
    194         } 
    195     } 
     187{ 
     188    if (blocks > (size_t)MALLOC_BLOCKS_THESHOLD) { 
     189        ::free((void*)memory); 
     190    } else if (blocks == 1) { 
     191        p.free(memory); 
     192    } else { 
     193        p.free(memory, blocks); 
     194    } 
     195} 
    196196#endif 
    197197 
     
    254254}; 
    255255 
    256 #endif // MIL_PRODUCER_MALLOC, MIL_PRODUCER_TBB 
     256#endif // MIL_MALLOC_PRODUCER, MIL_TBB_PRODUCER 
    257257 
    258258/** 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Module.h

    r34801 r34815  
    55 
    66namespace mil { 
     7 
    78/** 
    89 * public members should be thread safe 
    910 */ 
    10     template <typename Child> 
    11         class Module : public ModuleCommon<Module<Child>, MIL_DEFAULT_THREAD> { 
     11template <typename Child> 
     12class Module : public ModuleCommon<Module<Child>, MIL_DEFAULT_THREAD> { 
     13public: 
     14    Tls tls; 
     15    MIL_CRTP_CLASS_MEMBERS; 
     16 
     17private: 
     18    class EventBase : public boost::noncopyable { 
    1219    public: 
    13         Tls tls; 
    14         MIL_CRTP_CLASS_MEMBERS; 
    15  
    16     private: 
    17         class EventBase : public boost::noncopyable { 
    18         public: 
    19             void (*execute)(void* event, void* target); 
    20             intptr_t owner_id; 
    21             EventBase* next; 
    22         }; 
    23  
    24         class EventList : public boost::noncopyable { 
    25             EventBase* head; 
    26             EventBase* tail; 
    27             Mutex mutex; 
    28         public: 
    29             EventList() { 
     20        void (*execute)(void* event, void* target); 
     21        intptr_t owner_id; 
     22        EventBase* next; 
     23    }; 
     24 
     25    class EventList : public boost::noncopyable { 
     26        EventBase* head; 
     27        EventBase* tail; 
     28        Mutex mutex; 
     29    public: 
     30        EventList() { 
     31            head = NULL; 
     32            tail = NULL; 
     33        } 
     34 
     35        void push(EventBase& e) { 
     36            synchronized (mutex) { 
     37                e.next = NULL; 
     38                if (head == NULL) { // tail == NULL 
     39                    head = &e; 
     40                    tail = &e; 
     41                    return; 
     42                } 
     43                tail->next = &e; 
     44                tail = &e; 
     45            } 
     46        } 
     47 
     48        void pop() { 
     49            synchronized (mutex) { 
     50                if (!head) { 
     51                    return; 
     52                } 
     53                head = head->next; 
     54            } 
     55        } 
     56 
     57        EventBase* top() { 
     58            synchronized (mutex) { 
     59                return head; 
     60            } 
     61 
     62            return NULL; 
     63        } 
     64 
     65        void clear() { 
     66            synchronized (mutex) { 
    3067                head = NULL; 
    3168                tail = NULL; 
    3269            } 
    33  
    34             void push(EventBase& e) { 
    35                 synchronized (mutex) { 
    36                     e.next = NULL; 
    37                     if (head == NULL) { // tail == NULL 
    38                         head = &e; 
    39                         tail = &e; 
    40                         return; 
    41                     } 
    42                     tail->next = &e; 
    43                     tail = &e; 
    44                 } 
    45             } 
    46  
    47             void pop() { 
    48                 synchronized (mutex) { 
    49                     if (!head) { 
    50                         return; 
    51                     } 
    52                     head = head->next; 
    53                 } 
    54             } 
    55  
    56             EventBase* top() { 
    57                 synchronized (mutex) { 
    58                     return head; 
    59                 } 
    60  
    61                 return NULL; 
    62             } 
    63  
    64             void clear() { 
    65                 synchronized (mutex) { 
    66                     head = NULL; 
    67                     tail = NULL; 
    68                 } 
    69             } 
    70         }; 
    71  
    72         template <typename T> 
    73             class Event : public EventBase { 
    74         public: 
    75             typedef T DataType; 
    76             T data; 
    77         }; 
    78  
    79         friend class Module_test; 
    80  
    81     private: 
    82         EventList list; 
    83         Conditional c; 
    84         bool repost; 
    85         bool breakLoopRequest; 
    86         atomic<bool> isWaiting; 
    87  
     70        } 
     71    }; 
     72 
     73    template <typename T> 
     74    class Event : public EventBase { 
    8875    public: 
     76        typedef T DataType; 
     77        T data; 
     78    }; 
     79 
     80    friend class Module_test; 
     81 
     82private: 
     83    EventList list; 
     84    Conditional c; 
     85    bool repost; 
     86    bool breakLoopRequest; 
     87    atomic<bool> isWaiting; 
     88 
     89public: 
    8990    Module() : tls(this->thread_id), repost(false), breakLoopRequest(false), isWaiting(false) { 
    90         } 
    91  
    92         void run() { 
    93             MIL_MODULE_GET_SUPER_CHILD(*this).loop(); 
    94         } 
    95      
    96     protected: 
    97         void repostEvent() { 
    98             repost = true; 
    99         } 
    100  
    101         template <typename Data, typename Sender> 
    102             static void dispatcher(void* event_, void* target_) { 
    103             typedef Child Target; 
    104  
    105             // XXX type safety?? 
    106             Target& target = *static_cast<Target*>(target_); 
    107             Event<Data>& event = *static_cast<Event<Data>*>(event_); 
    108             target.list.pop(); 
    109             target.repost = false; 
    110             ModuleExecuteProxy::execute<Data, Target>(event.data, target); 
    111             if (target.repost) { 
    112                 target.list.push(event); 
    113                 return; 
    114             } 
    115  
    116             if (IsExitEvent<Data>::value) { 
    117                 return; 
    118             } 
    119  
    120             if (pool::is_return_memory_event<Event<Data> >() || unlikely(event.owner_id == target.thread_id)) { 
    121                 // ReturnMemoryEvent 
    122                 size_t blocks = pool::bytes_to_blocks(return_memory_considered_sizeof<Data>()); 
    123                 target.tls.producer.free(&event, blocks); 
    124                 return; 
    125             } 
    126          
    127             pool::MemoryList* m = target.tls.consumer.pop(event.owner_id); 
    128             if (!m) { 
    129                 target.tls.consumer.store(&event); 
    130                 return; 
    131             } 
    132          
    133             pool::ReturnMemoryEvent<sizeof(Event<Data>)> e; 
    134             e.memory = m; 
    135             void* t = threads[event.owner_id].load(); 
    136             if (unlikely(!t)) { 
    137                 return; 
    138             } 
    139             (reinterpret_cast<Sender*>(t))->post(e, target, (void*)&event, event.owner_id); 
    140         } 
    141  
    142     public: 
    143         template <typename T, typename Sender> 
    144             //void post(const T& event, Sender& sender, void* memory, intptr_t owner_id) 
    145             void post(const T& event, Sender&, void* memory, intptr_t owner_id) { 
    146             Event<T>* e = new(memory) Event<T>; 
    147             e->data = event; 
    148             e->execute = dispatcher<T, Sender>; 
    149             e->owner_id = owner_id; 
    150  
    151             list.push(*e); 
    152             if (isWaiting.load()) { 
    153                 c.signal(); 
    154             } 
    155         } 
    156  
    157         template <typename T, typename Sender> 
    158             void post(const T& event, Sender& sender) { 
    159             pool::Producer& producer = sender.tls.producer; 
    160             void* memory = producer.malloc<sizeof(Event<T>)>(); 
    161             if (unlikely(memory == NULL)) { 
    162                 halt << "can't allocate event memory"; 
    163                 return; 
    164             } 
    165  
    166             post(event, sender, memory, sender.tls.thread_id); 
    167         } 
    168     public: 
    169         void destroy() { 
    170             breakLoopRequest = true; 
    171         } 
    172  
    173         void requestExit(void* event_memory) { 
    174             list.clear(); 
    175             exitNotifier.tls.flush(); 
    176             ExitEvent e; 
    177             post(e, exitNotifier, event_memory, exitNotifier.tls.thread_id); 
    178         } 
    179  
    180         ~Module() { 
    181             do_auto_join(); 
    182         } 
    183  
    184         bool execute_front() { 
     91    } 
     92 
     93    void run() { 
     94        MIL_MODULE_GET_SUPER_CHILD(*this).loop(); 
     95    } 
     96 
     97protected: 
     98    void repostEvent() { 
     99        repost = true; 
     100    } 
     101 
     102    template <typename Data, typename Sender> 
     103    static void dispatcher(void* event_, void* target_) { 
     104        typedef Child Target; 
     105 
     106        // XXX type safety?? 
     107        Target& target = *static_cast<Target*>(target_); 
     108        Event<Data>& event = *static_cast<Event<Data>*>(event_); 
     109        target.list.pop(); 
     110        target.repost = false; 
     111        ModuleExecuteProxy::execute<Data, Target>(event.data, target); 
     112        if (target.repost) { 
     113            target.list.push(event); 
     114            return; 
     115        } 
     116 
     117        if (IsExitEvent<Data>::value) { 
     118            return; 
     119        } 
     120 
     121        if (pool::is_return_memory_event<Event<Data> >() || unlikely(event.owner_id == target.thread_id)) { 
     122            // ReturnMemoryEvent 
     123            size_t blocks = pool::bytes_to_blocks(return_memory_considered_sizeof<Data>()); 
     124            target.tls.producer.free(&event, blocks); 
     125            return; 
     126        } 
     127 
     128        pool::MemoryList* m = target.tls.consumer.pop(event.owner_id); 
     129        if (!m) { 
     130            target.tls.consumer.store(&event); 
     131            return; 
     132        } 
     133 
     134        pool::ReturnMemoryEvent<sizeof(Event<Data>)> e; 
     135        e.memory = m; 
     136        void* t = threads[event.owner_id].load(); 
     137        if (unlikely(!t)) { 
     138            return; 
     139        } 
     140        (reinterpret_cast<Sender*>(t))->post(e, target, (void*)&event, event.owner_id); 
     141    } 
     142 
     143public: 
     144    template <typename T, typename Sender> 
     145    //void post(const T& event, Sender& sender, void* memory, intptr_t owner_id) 
     146    void post(const T& event, Sender&, void* memory, intptr_t owner_id) { 
     147        Event<T>* e = new(memory) Event<T>; 
     148        e->data = event; 
     149        e->execute = dispatcher<T, Sender>; 
     150        e->owner_id = owner_id; 
     151 
     152        list.push(*e); 
     153        if (isWaiting.load()) { 
     154            c.signal(); 
     155        } 
     156    } 
     157 
     158    template <typename T, typename Sender> 
     159    void post(const T& event, Sender& sender) { 
     160        pool::Producer& producer = sender.tls.producer; 
     161        void* memory = producer.malloc<sizeof(Event<T>)>(); 
     162        if (unlikely(memory == NULL)) { 
     163            halt << "can't allocate event memory"; 
     164            return; 
     165        } 
     166 
     167        post(event, sender, memory, sender.tls.thread_id); 
     168    } 
     169public: 
     170    void destroy() { 
     171        breakLoopRequest = true; 
     172    } 
     173 
     174    void requestExit(void* event_memory) { 
     175        list.clear(); 
     176        exitNotifier.tls.flush(); 
     177        ExitEvent e; 
     178        post(e, exitNotifier, event_memory, exitNotifier.tls.thread_id); 
     179    } 
     180 
     181    ~Module() { 
     182        do_auto_join(); 
     183    } 
     184 
     185    bool execute_front() { 
     186        EventBase* e = list.top(); 
     187        if (e) { 
     188            e->execute((void*)e, (void*)this); 
     189            return true; 
     190        } 
     191        return false; 
     192    } 
     193 
     194protected: 
     195    void loop() { 
     196        while (!breakLoopRequest) { 
    185197            EventBase* e = list.top(); 
    186198            if (e) { 
    187199                e->execute((void*)e, (void*)this); 
    188                 return true; 
    189             } 
    190             return false; 
    191         } 
    192  
    193     protected: 
    194         void loop() { 
    195             while (!breakLoopRequest) { 
    196                 EventBase* e = list.top(); 
    197                 if (e) { 
    198                     e->execute((void*)e, (void*)this); 
    199                 } else { 
    200                     isWaiting.store(true); 
    201                     c.wait(); 
    202                     isWaiting.store(false); 
    203                 } 
    204             } 
    205             breakLoopRequest = false; 
    206         } 
    207     }; 
     200            } else { 
     201                isWaiting.store(true); 
     202                c.wait(); 
     203                isWaiting.store(false); 
     204            } 
     205        } 
     206        breakLoopRequest = false; 
     207    } 
     208}; 
    208209 
    209210} 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/ModuleCommon.h

    r34794 r34815  
    6262    template <class EventData, class Target> 
    6363    static void execute_body(EventData& data, Target& target, ...) { 
    64         MIL_MODULE_SUPER_CHILD_TYPE(Target)& o =  
     64        MIL_MODULE_SUPER_CHILD_TYPE(Target)& o = 
    6565            MIL_MODULE_GET_SUPER_CHILD(target); 
    6666 
     
    7070    template <class, class Target> 
    7171    static void execute_body(ExitEvent, Target& target, ...) { 
    72         MIL_MODULE_SUPER_CHILD_TYPE(Target)& o =  
     72        MIL_MODULE_SUPER_CHILD_TYPE(Target)& o = 
    7373            MIL_MODULE_GET_SUPER_CHILD(target); 
    7474 
     
    9494template <class T> 
    9595void post_exit_template(void* obj, void* event_memory) { 
    96     MIL_MODULE_SUPER_CHILD_TYPE(T)& o =  
     96    MIL_MODULE_SUPER_CHILD_TYPE(T)& o = 
    9797        MIL_MODULE_GET_SUPER_CHILD(*reinterpret_cast<T*>(obj)); 
    9898 
     
    102102template <class T> 
    103103void join_template(void* obj) { 
    104     MIL_MODULE_SUPER_CHILD_TYPE(T)& o =  
     104    MIL_MODULE_SUPER_CHILD_TYPE(T)& o = 
    105105        MIL_MODULE_GET_SUPER_CHILD(*reinterpret_cast<T*>(obj)); 
    106106 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/PrecompiledHeaders.h

    r34328 r34815  
    139139//#include <boost/crc.hpp> 
    140140#include <boost/cstdint.hpp> 
    141 #include <boost/format.hpp> 
     141//#include <boost/format.hpp> 
    142142//#include <boost/foreach.hpp> 
    143143//#include <boost/function.hpp> 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/Thread.h

    r34792 r34815  
    178178    static int thread_routine_filtered(int, char** argv) { 
    179179        Thread<Child, ThreadType>* obj = (Thread<Child, ThreadType>*)argv; 
    180                 typedef Thread<Child, ThreadType> Type; 
    181  
    182         MIL_MODULE_SUPER_CHILD_TYPE(Type)& o =  
     180        typedef Thread<Child, ThreadType> Type; 
     181 
     182        MIL_MODULE_SUPER_CHILD_TYPE(Type)& o = 
    183183            MIL_MODULE_GET_SUPER_CHILD(*obj); 
    184184 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/gui-cocoa/CocoaThread.h

    r34792 r34815  
    11#pragma once 
    22 
    3 @interface WorkerThread : NSObject { 
     3@interface WorkerThread : 
     4NSObject { 
    45    void* (*routine)(void*); 
    56    void* arg; 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/gui-cocoa/GuiModuleObjC.h

    r34447 r34815  
    1 @interface WindowType : NSWindow 
    2 { 
     1@interface WindowType : 
     2NSWindow { 
    33    ParentType* parent; 
    44} 
  • lang/objective-cplusplus/i3/trunk/src/mil/include/mil/gui-windows/GuiModule.h

    r34801 r34815  
    1717*/ 
    1818template <typename Child> 
    19     class GuiModule : public ModuleCommon<GuiModule<Child>, MIL_DEFAULT_THREAD> { 
     19class GuiModule : public ModuleCommon<GuiModule<Child>, MIL_DEFAULT_THREAD> { 
    2020public: 
    2121    MIL_CRTP_CLASS_MEMBERS; 
     
    2727 
    2828    template <typename T> 
    29         class Event : public EventBase { 
     29    class Event : public EventBase { 
    3030    public: 
    3131        typedef T DataType; 
     
    5050    Tls tls; 
    5151 
    52 GuiModule() : 
    53     hSharedWnd(NULL), 
    54         breakLoopRequest(false), 
    55         breakLoopRequestShared(false), 
    56         repost(false), 
    57         handled(true), 
    58         handled_result(0), 
    59         hLocalWnd(NULL), 
    60         tls(this->thread_id), 
    61         wndproc(getChild()) { 
     52    GuiModule() : 
     53            hSharedWnd(NULL), 
     54            breakLoopRequest(false), 
     55            breakLoopRequestShared(false), 
     56            repost(false), 
     57            handled(true), 
     58            handled_result(0), 
     59            hLocalWnd(NULL), 
     60            tls(this->thread_id), 
     61            wndproc(getChild()) { 
    6262    } 
    6363 
     
    8282 
    8383    template <typename Data, typename Sender> 
    84         static void dispatch(void* event_, void* target_) { 
     84    static void dispatch(void* event_, void* target_) { 
    8585        typedef Child Target; 
    8686        Target& target = *static_cast<Target*>(target_); 
     
    121121            return; 
    122122        } 
    123      
     123 
    124124        pool::MemoryList* m = target.tls.consumer.pop(event.owner_id); 
    125125        if (!m) { 
     
    127127            return; 
    128128        } 
    129      
     129 
    130130        pool::ReturnMemoryEvent<sizeof(Event<Data>)> e; 
    131131        e.memory = m; 
     
    197197 
    198198    template <typename Sender> 
    199         HWND getCachedHWnd(Sender& sender, bool flush = false) { 
     199    HWND getCachedHWnd(Sender& sender, bool flush = false) { 
    200200        HWND hWnd = NULL; 
    201201 
     
    212212 
    213213    template <class Sender> 
    214         void postWindowsMessage(Sender& sender, UINT msg, LPARAM lParam, WPARAM wParam) { 
     214    void postWindowsMessage(Sender& sender, UINT msg, LPARAM lParam, WPARAM wParam) { 
    215215        if (!PostMessage(getCachedHWnd(sender), msg, lParam, wParam)) { 
    216216            DWORD e = GetLastError(); 
     
    222222 
    223223    template <typename T, typename Sender> 
    224         void post(const T& event, Sender& sender, void* memory, intptr_t owner_id) { 
     224    void post(const T& event, Sender& sender, void* memory, intptr_t owner_id) { 
    225225        Event<T>* e = new(memory) Event<T>; 
    226226        e->data = event; 
     
    234234 
    235235    template <typename T, typename Sender> 
    236         void post(const T& event, Sender& sender) { 
     236    void post(const T& event, Sender& sender) { 
    237237        if (sizeof(T) <= sizeof(LPARAM)) { 
    238238            LPARAM l = 0; 
     
    314314 
    315315    mil::WindowProcedureRedirector< 
    316         GuiModule<Child>, &GuiModule<Child>::WindowProcedure> wndproc; 
     316    GuiModule<Child>, &GuiModule<Child>::WindowProcedure> wndproc; 
    317317}; 
    318318 
  • lang/objective-cplusplus/i3/trunk/src/mil/src/Test1.cpp

    r34474 r34815  
    320320        m.execute_front(); 
    321321        QT_CHECK_EQUAL(global, 3); 
    322          
     322 
    323323    } 
    324324    { 
  • lang/objective-cplusplus/i3/trunk/src/mil/src/Test10.cpp

    r34519 r34815  
    2424 
    2525    QT_CHECK_EQUAL(a.load(), (T)0); 
    26      
     26 
    2727    a.store((T)1); 
    2828    QT_CHECK_EQUAL(a.load(), (T)1); 
     
    5454    a.store((T)I28BIT(0x12345678)); 
    5555    bool b = a.bool_compare_and_swap( 
    56         (T)I28BIT(0x12345678), (T)I28BIT(0xabcdef98)); 
     56                 (T)I28BIT(0x12345678), (T)I28BIT(0xabcdef98)); 
    5757    QT_CHECK_EQUAL(b, true); 
    5858    QT_CHECK_EQUAL(a.load(), (T)I28BIT(0xabcdef98)); 
    59      
     59 
    6060    b = a.bool_compare_and_swap( 
    61         (T)I28BIT(0x12345678), (T)I28BIT(0xabcdef98)); 
     61            (T)I28BIT(0x12345678), (T)I28BIT(0xabcdef98)); 
    6262    QT_CHECK_EQUAL(b, false); 
    6363    QT_CHECK_EQUAL(a.load(), (T)I28BIT(0xabcdef98)); 
     
    8282    a.store(-8); 
    8383    QT_CHECK_EQUAL(a.load(), -8); 
    84      
     84 
    8585    temp = a.fetch_and_add(-10); 
    8686    QT_CHECK_EQUAL(temp, -8); 
     
    120120    DoubleBuffer<int> db; 
    121121    int data = 0; 
    122      
     122 
    123123    db.write(100); 
    124124    db.read(data); 
  • lang/objective-cplusplus/i3/trunk/src/mil/src/Test11.cpp

    r34812 r34815  
    128128 
    129129QT_TEST(test_iaodfioasdfadfaadfasdfadfiiiii) { 
     130 
     131#ifdef MIL_DEBUG_PRODUCER 
     132    puts("debug producer"); 
     133#endif 
     134 
     135#ifdef MIL_TBB_PRODUCER 
     136    puts("tbb producer"); 
     137#endif 
     138 
     139#ifdef MIL_MALLOC_PRODUCER 
     140    puts("malloc producer"); 
     141#endif 
     142 
    130143    n_times(); 
    131144    puts("---"); 
  • lang/objective-cplusplus/i3/trunk/src/mil/src/Test5.cpp

    r34447 r34815  
    7272    { 
    7373        int c = 8; 
    74         for (ForScopeChecker c;false;) { 
     74        for (ForScopeChecker c; false;) { 
    7575        } 
    7676        c = c / 5 % 8 * 124; 
  • lang/objective-cplusplus/i3/trunk/src/mil/src/Test8.cpp

    r34769 r34815  
    120120    QT_CHECK_NOT_EQUAL(v1.capacity(), v2.capacity()); 
    121121    v2 = v1; 
    122     QT_CHECK_NOT_EQUAL(v1.capacity(), v2.capacity());     
     122    QT_CHECK_NOT_EQUAL(v1.capacity(), v2.capacity()); 
    123123} 
    124124 
  • lang/objective-cplusplus/i3/trunk/src/mil/src/Test9.cpp

    r34769 r34815  
    160160 
    161161        for (int i = 0; i < 50; i++) { 
    162         
     162 
    163163            MiddleEvent m; 
    164164            m.data = 2; 
  • lang/objective-cplusplus/i3/trunk/src/os-windows/CygwinPty.cpp

    r34678 r34815  
    55template <size_t Size> 
    66bool query_registory(HKEY root, const TCHAR* SubKey, const TCHAR* value, TCHAR (&retval)[Size]) { 
    7     HKEY hkResult = NULL; 
     7    HKEY hKey = NULL; 
    88    LONG result = RegOpenKeyEx( 
    9         root, 
    10         SubKey, 
    11         0, 
    12         KEY_EXECUTE, 
    13         &hkResult); 
    14      
     9                      root, 
     10                      SubKey, 
     11                      0, 
     12                      KEY_EXECUTE, 
     13                      &hKey); 
     14 
    1515    if (result != ERROR_SUCCESS) { 
    1616        return false; 
     
    2020    DWORD cbCd = sizeof(retval); 
    2121    result = RegQueryValueEx( 
    22         hkResult, 
    23         value, 
    24         NULL, 
    25         &type, 
    26         (BYTE*)retval, 
    27         &cbCd); 
     22                 hKey, 
     23                 value, 
     24                 NULL, 
     25                 &type, 
     26                 (BYTE*)retval, 
     27                 &cbCd); 
    2828 
     29    RegClose(hKey); 
    2930    if (result != ERROR_SUCCESS) { 
    3031        return false; 
     
    6768    TCHAR cd[2000] = {}; 
    6869    if (!query_registory(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Cygwin\\setup"), TEXT("rootdir"), cd) && 
    69         !query_registory(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Wow6432Node\\Cygwin\\setup"), TEXT("rootdir"), cd) && 
    70         !query_registory(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/"), TEXT("native"), cd) && 
    71         !query_registory(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Wow6432Node\\Cygnus Solutions\\Cygwin\\mounts v2\\/"), TEXT("native"), cd)) { 
     70            !query_registory(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Wow6432Node\\Cygwin\\setup"), TEXT("rootdir"), cd) && 
     71            !query_registory(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Cygnus Solutions\\Cygwin\\mounts v2\\/"), TEXT("native"), cd) && 
     72            !query_registory(HKEY_LOCAL_MACHINE, TEXT("SOFTWARE\\Wow6432Node\\Cygnus Solutions\\Cygwin\\mounts v2\\/"), TEXT("native"), cd)) { 
    7273        return false; 
    7374    } 
     
    8586    HANDLE cp = GetCurrentProcess(); 
    8687    if (!DuplicateHandle(cp, hMyStdInput , cp, NULL, 0, FALSE, DUPLICATE_SAME_ACCESS) || 
    87         !DuplicateHandle(cp, hMyStdOutput, cp, NULL, 0, FALSE, DUPLICATE_SAME_ACCESS) || 
    88         !DuplicateHandle(cp, hMyStdError , cp, NULL, 0, FALSE, DUPLICATE_SAME_ACCESS)) { 
     88            !DuplicateHandle(cp, hMyStdOutput, cp, NULL, 0, FALSE, DUPLICATE_SAME_ACCESS) || 
     89            !DuplicateHandle(cp, hMyStdError , cp, NULL, 0, FALSE, DUPLICATE_SAME_ACCESS)) { 
    8990 
    9091        return false; 
  • lang/objective-cplusplus/i3/trunk/src/os-windows/WindowsCommon.h

    r34447 r34815  
    6262namespace i3 { 
    6363extern struct dll_ { 
    64         BOOL (WINAPI *dll_SetLayeredWindowAttributes)(COLORREF crKey, BYTE bAlpha, DWORD dwFlags); 
     64    BOOL (WINAPI *dll_SetLayeredWindowAttributes)(COLORREF crKey, BYTE bAlpha, DWORD dwFlags); 
    6565 
    66         bool have_dwmapi_dll; 
    67         HRESULT (WINAPI *dll_DwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS *pMarInset); 
    68         HRESULT (WINAPI *dll_DwmIsCompositionEnabled)(BOOL *pfEnabled); 
    69         HRESULT (WINAPI *dll_DwmEnableBlurBehindWindow)(HWND hWnd, const DWM_BLURBEHIND *pBlurBehind); 
    70         HRESULT (WINAPI *dll_DwmGetColorizationColor)(DWORD *pcrColorization, BOOL *pfOpaqueBlend); 
    71     } dll; 
     66    bool have_dwmapi_dll; 
     67    HRESULT (WINAPI *dll_DwmExtendFrameIntoClientArea)(HWND hWnd, const MARGINS *pMarInset); 
     68    HRESULT (WINAPI *dll_DwmIsCompositionEnabled)(BOOL *pfEnabled); 
     69    HRESULT (WINAPI *dll_DwmEnableBlurBehindWindow)(HWND hWnd, const DWM_BLURBEHIND *pBlurBehind); 
     70    HRESULT (WINAPI *dll_DwmGetColorizationColor)(DWORD *pcrColorization, BOOL *pfOpaqueBlend); 
     71} dll; 
    7272extern HINSTANCE hInstance; 
    7373 
  • lang/objective-cplusplus/i3/trunk/windows/release.sh

    r34769 r34815  
    1111#export CROSS_HOST=i386-mingw32msvc 
    1212export CROSS_HOST=i586-mingw32msvc 
    13 export CFLAGS="-O3 -DNDEBUG" 
     13export CFLAGS="-O3 -DNDEBUG -U_DEBUG" 
    1414export CXXFLAGS="$CFLAGS"  
    15 export LDFLAGS="-s -L/usr/local/$CROSS_HOST/lib" 
     15export LDFLAGS="-s" 
    1616# cross compile: 
    1717# *binutils