Changeset 10887


Ignore:
Timestamp:
Sep 26, 2008, 1:56:44 PM (11 years ago)
Author:
gb
Message:

Try to use new format-string constants.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/memory.c

    r10718 r10887  
    4444{
    4545  char buf[64];
    46   sprintf(buf, "Can't allocate %s of size %Id bytes.", pointerp ? "pointer" : "handle", size);
     46  sprintf(buf, "Can't allocate %s of size " DECIMAL " bytes.", pointerp ? "pointer" : "handle", size);
    4747  Fatal(":   Kernel memory allocation failure.  ", buf);
    4848}
     
    178178                       PAGE_NOACCESS);
    179179  if (!start) {
    180     fprintf(stderr, "Can't get desired heap address at 0x%Ix\n", want);
     180    fprintf(stderr, "Can't get desired heap address at 0x" LISP "\n", want);
    181181    start = VirtualAlloc(0,
    182182                         totalsize + heap_segment_size,
     
    210210#endif
    211211#if DEBUG_MEMORY
    212   fprintf(stderr, "Reserving heap at 0x%Ix, size 0x%Ix\n", start, totalsize);
     212  fprintf(stderr, "Reserving heap at 0x" LISP ", size 0x" LISP "\n", start, totalsize);
    213213#endif
    214214  return start;
     
    219219  LogicalAddress rc;
    220220#if DEBUG_MEMORY
    221   fprintf(stderr, "Committing memory at 0x%Ix, size 0x%Ix\n", start, len);
     221  fprintf(stderr, "Committing memory at 0x" LISP ", size 0x" LISP "\n", start, len);
    222222#endif
    223223#ifdef WINDOWS
     
    252252UnCommitMemory (LogicalAddress start, natural len) {
    253253#if DEBUG_MEMORY
    254   fprintf(stderr, "Uncommitting memory at 0x%Ix, size 0x%Ix\n", start, len);
     254  fprintf(stderr, "Uncommitting memory at 0x" LISP ", size 0x" LISP "\n", start, len);
    255255#endif
    256256#ifdef WINDOWS
     
    279279{
    280280#if DEBUG_MEMORY
    281   fprintf(stderr, "Mapping memory at 0x%Ix, size 0x%Ix\n", addr, nbytes);
     281  fprintf(stderr, "Mapping memory at 0x" LISP ", size 0x" LISP "\n", addr, nbytes);
    282282#endif
    283283#ifdef WINDOWS
     
    292292{
    293293#if DEBUG_MEMORY
    294   fprintf(stderr, "Mapping stack of size 0x%Ix\n", nbytes);
     294  fprintf(stderr, "Mapping stack of size 0x" LISP "\n", nbytes);
    295295#endif
    296296#ifdef WINDOWS
     
    305305{
    306306#if DEBUG_MEMORY
    307   fprintf(stderr, "Unmapping memory at 0x%Ix, size 0x%Ix\n", addr, nbytes);
     307  fprintf(stderr, "Unmapping memory at 0x" LISP ", size 0x" LISP "\n", addr, nbytes);
    308308#endif
    309309#ifdef WINDOWS
     
    319319{
    320320#if DEBUG_MEMORY
    321   fprintf(stderr, "Protecting memory at 0x%Ix, size 0x%Ix\n", addr, nbytes);
     321  fprintf(stderr, "Protecting memory at 0x" LISP ", size 0x" LISP "\n", addr, nbytes);
    322322#endif
    323323#ifdef WINDOWS
     
    327327  if(!status) {
    328328    wperror("ProtectMemory VirtualProtect");
    329     Bug(NULL, "couldn't protect %Id bytes at %x, errno = %d", nbytes, addr, status);
     329    Bug(NULL, "couldn't protect " DECIMAL " bytes at 0x" LISP ", errno = %d", nbytes, addr, status);
    330330  }
    331331  return status;
     
    335335  if (status) {
    336336    status = errno;
    337     Bug(NULL, "couldn't protect %Id bytes at %Ix, errno = %d", nbytes, addr, status);
     337    Bug(NULL, "couldn't protect " DECIMAL " bytes at " LISP ", errno = %d", nbytes, addr, status);
    338338  }
    339339  return status;
     
    345345{
    346346#if DEBUG_MEMORY
    347   fprintf(stderr, "Unprotecting memory at 0x%Ix, size 0x%Ix\n", addr, nbytes);
     347  fprintf(stderr, "Unprotecting memory at 0x" LISP ", size 0x" LISP "\n", addr, nbytes);
    348348#endif
    349349#ifdef WINDOWS
     
    398398    count = read(fd, addr + total, nbytes - total);
    399399    total += count;
    400     // fprintf(stderr, "read %Id bytes, for a total of %Id out of %Id so far\n", count, total, nbytes);
     400    // fprintf(stderr, "read " DECIMAL " bytes, for a total of " DECIMAL " out of " DECIMAL " so far\n", count, total, nbytes);
    401401    if (!(count > 0))
    402402      return false;
Note: See TracChangeset for help on using the changeset viewer.