Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 794:661384d6a936

Show
Ignore:
Timestamp:
11/28/08 15:24:08 (1 month ago)
Author:
Christian Kamm <kamm incasoftware de>
branch:
default
Message:

Fix warnings on x86-64. By fvbommel.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmd/attrib.c

    r737 r794  
    780780        { 
    781781            StringExp *se = (StringExp *)e; 
    782             fprintf(stdmsg, "%.*s", (int)se->len, se->string); 
     782            fprintf(stdmsg, "%.*s", (int)se->len, (char*)se->string); 
    783783        } 
    784784        else 
  • dmd/dump.c

    r305 r794  
    5353{ 
    5454    indent(i); 
    55     printf("%p %lld type=%s\n", this, (intmax_t)value, type_print(type)); 
     55    printf("%p %lld type=%s\n", this, (long long)value, type_print(type)); 
    5656} 
    5757 
  • dmd/expression.c

    r779 r794  
    48654865 
    48664866    if (global.params.verbose) 
    4867     printf("file      %s\t(%s)\n", se->string, name); 
     4867    printf("file      %s\t(%s)\n", (char*)se->string, name); 
    48684868 
    48694869    {   File f(name); 
  • dmd/lexer.c

    r717 r794  
    139139 
    140140    case TOKint64v: 
    141         sprintf(buffer,"%lldL",int64value); 
     141        sprintf(buffer,"%lldL",(long long)int64value); 
    142142        break; 
    143143 
    144144    case TOKuns64v: 
    145         sprintf(buffer,"%lluUL",uns64value); 
     145        sprintf(buffer,"%lluUL",(unsigned long long)uns64value); 
    146146        break; 
    147147 
  • dmd/statement.c

    r765 r794  
    21362136                { 
    21372137                    StringExp *se = (StringExp *)e; 
    2138                     fprintf(stdmsg, "%.*s", (int)se->len, se->string); 
     2138                    fprintf(stdmsg, "%.*s", (int)se->len, (char*)se->string); 
    21392139                } 
    21402140                else 
  • gen/arrays.cpp

    r778 r794  
    2525    if (elemty == LLType::VoidTy) 
    2626        elemty = LLType::Int8Ty; 
    27     return LLStructType::get(DtoSize_t(), getPtrToType(elemty), 0); 
     27    return LLStructType::get(DtoSize_t(), getPtrToType(elemty), NULL); 
    2828} 
    2929 
    3030const LLStructType* DtoArrayType(const LLType* t) 
    3131{ 
    32     return LLStructType::get(DtoSize_t(), getPtrToType(t), 0); 
     32    return LLStructType::get(DtoSize_t(), getPtrToType(t), NULL); 
    3333} 
    3434 
  • gen/asmstmt.cpp

    r758 r794  
    77//#include "d-gcc-includes.h" 
    88//#include "total.h" 
     9#include "mars.h" 
    910#include "statement.h" 
    1011#include "scope.h" 
     
    420421        size_t pos = insnt.find(needle); 
    421422        if(std::string::npos != pos) 
    422             sprintf(buf, "%u", idx++); 
     423            sprintf(buf, "%" PRIuSIZE, idx++); 
    423424        while(std::string::npos != (pos = insnt.find(needle))) 
    424425            insnt.replace(pos, needle.size(), buf); 
     
    445446        size_t pos = insnt.find(needle); 
    446447        if(std::string::npos != pos) 
    447             sprintf(buf, "%u", idx++); 
     448            sprintf(buf, "%" PRIuSIZE, idx++); 
    448449        while(std::string::npos != (pos = insnt.find(needle))) 
    449450            insnt.replace(pos, needle.size(), buf); 
  • gen/llvmhelpers.cpp

    r784 r794  
    16501650        sprintf(tmp, "1"); 
    16511651    else 
    1652         sprintf(tmp, "%d", T->size()*8); 
     1652        sprintf(tmp, "%lu", T->size()*8); 
    16531653     
    16541654    // replace # in name with bitsize 
  • gen/logger.cpp

    r246 r794  
    4040    { 
    4141        if (_enabled) { 
    42             printf(indent_str.c_str()); 
     42            printf("%s", indent_str.c_str()); 
    4343            va_list va; 
    4444            va_start(va,fmt); 
     
    5151    { 
    5252        if (_enabled) { 
    53             printf(indent_str.c_str()); 
     53            printf("%s", indent_str.c_str()); 
    5454            va_list va; 
    5555            va_start(va,fmt); 
  • gen/runtime.cpp

    r741 r794  
    111111static const LLType* rt_array(const LLType* elemty) 
    112112{ 
    113     return llvm::StructType::get(DtoSize_t(), rt_ptr(elemty), 0); 
     113    return llvm::StructType::get(DtoSize_t(), rt_ptr(elemty), NULL); 
    114114} 
    115115 
     
    120120    types.push_back(rt_ptr(LLType::Int8Ty)); 
    121121    const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); 
    122     return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), 0); 
     122    return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); 
    123123} 
    124124 
     
    130130    types.push_back(rt_ptr(LLType::Int8Ty)); 
    131131    const llvm::FunctionType* fty = llvm::FunctionType::get(LLType::Int32Ty, types, false); 
    132     return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), 0); 
     132    return llvm::StructType::get(rt_ptr(LLType::Int8Ty), rt_ptr(fty), NULL); 
    133133} 
    134134 
     
    153153        realTy = LLType::DoubleTy; 
    154154 
    155     const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, 0); 
    156     const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, 0); 
    157     const LLType* crealTy = llvm::StructType::get(realTy, realTy, 0); 
     155    const LLType* cfloatTy = llvm::StructType::get(floatTy, floatTy, NULL); 
     156    const LLType* cdoubleTy = llvm::StructType::get(doubleTy, doubleTy, NULL); 
     157    const LLType* crealTy = llvm::StructType::get(realTy, realTy, NULL); 
    158158 
    159159    const LLType* voidPtrTy = rt_ptr(byteTy); 
  • gen/tollvm.cpp

    r758 r794  
    230230    const LLType* func = DtoFunctionType(t->nextOf(), NULL, i8ptr); 
    231231    const LLType* funcptr = getPtrToType(func); 
    232     return LLStructType::get(i8ptr, funcptr, 0); 
     232    return LLStructType::get(i8ptr, funcptr, NULL); 
    233233} 
    234234 
     
    741741    else if (global.params.os == OSFreeBSD) { 
    742742        // Just a pointer 
    743         return LLStructType::get(DtoSize_t(), 0); 
     743        return LLStructType::get(DtoSize_t(), NULL); 
    744744    } 
    745745 
     
    814814LLValue* DtoAggrPair(LLValue* V1, LLValue* V2, const char* name) 
    815815{ 
    816     const LLType* t = LLStructType::get(V1->getType(), V2->getType(), 0); 
     816    const LLType* t = LLStructType::get(V1->getType(), V2->getType(), NULL); 
    817817    return DtoAggrPair(t, V1, V2, name); 
    818818} 
  • runtime/internal/eh.d

    r741 r794  
    281281    // get classinfo for action and check if the one in the 
    282282    // exception structure is a base 
    283     ClassInfo catch_ci = classinfo_table[-ti_offset]
     283    ClassInfo catch_ci = *(classinfo_table - ti_offset)
    284284    debug(EH_personality) printf("Comparing catch %s to exception %s\n", catch_ci.name.ptr, exception_struct.exception_object.classinfo.name.ptr); 
    285285    if(_d_isbaseof(exception_struct.exception_object.classinfo, catch_ci)) 
     
    321321    debug(EH_personality) printf("Setting switch value to: %d!\n", switchval); 
    322322    _Unwind_SetGR(context, eh_exception_regno, cast(ulong)cast(void*)(exception_struct.exception_object)); 
    323     _Unwind_SetGR(context, eh_selector_regno, switchval); 
     323    _Unwind_SetGR(context, eh_selector_regno, cast(ulong)switchval); 
    324324    _Unwind_SetIP(context, landing_pad); 
    325325    return _Unwind_Reason_Code.INSTALL_CONTEXT; 
  • runtime/internal/memory.d

    r664 r794  
    264264 
    265265        int   fd = open("/proc/self/maps", O_RDONLY); 
    266         int   count; // %% need to configure ret for read.. 
     266        ptrdiff_t   count; // %% need to configure ret for read.. 
    267267        char  buf[2024]; 
    268268        char* p; 
     
    339339                    { 
    340340                        count = p - s; 
    341                         memmove(buf.ptr, s, count); 
     341                        memmove(buf.ptr, s, cast(size_t)count); 
    342342                        p = buf.ptr + count; 
    343343                        break; 
Copyright © 2008, LDC Development Team.