Mercurial > vim
comparison src/os_amiga.c @ 16825:ce04ebdf26b8 v8.1.1414
patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts
commit https://github.com/vim/vim/commit/c799fe206e61f2e2c1231bc46cbe4bb354f3da69
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 28 23:08:19 2019 +0200
patch 8.1.1414: alloc() returning "char_u *" causes a lot of type casts
Problem: Alloc() returning "char_u *" causes a lot of type casts.
Solution: Have it return "void *". (Mike Williams) Define ALLOC_ONE() to
check the simple allocations.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 28 May 2019 23:15:10 +0200 |
parents | 695d9ef00b03 |
children | 9185ba71aae6 |
comparison
equal
deleted
inserted
replaced
16824:1f6bb29738d2 | 16825:ce04ebdf26b8 |
---|---|
578 if (fname == NULL) /* safety check */ | 578 if (fname == NULL) /* safety check */ |
579 return NULL; | 579 return NULL; |
580 #ifdef __amigaos4__ | 580 #ifdef __amigaos4__ |
581 fib = AllocDosObject(DOS_FIB,0); | 581 fib = AllocDosObject(DOS_FIB,0); |
582 #else | 582 #else |
583 fib = (struct FileInfoBlock *)alloc(sizeof(struct FileInfoBlock)); | 583 fib = ALLOC_ONE(struct FileInfoBlock); |
584 #endif | 584 #endif |
585 if (fib != NULL) | 585 if (fib != NULL) |
586 { | 586 { |
587 flock = Lock((UBYTE *)fname, (long)ACCESS_READ); | 587 flock = Lock((UBYTE *)fname, (long)ACCESS_READ); |
588 if (flock == (BPTR)NULL || !Examine(flock, fib)) | 588 if (flock == (BPTR)NULL || !Examine(flock, fib)) |
1446 | 1446 |
1447 /* Get our AnchorBase */ | 1447 /* Get our AnchorBase */ |
1448 #ifdef __amigaos4__ | 1448 #ifdef __amigaos4__ |
1449 Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags); | 1449 Anchor = AllocDosObject(DOS_ANCHORPATH, AnchorTags); |
1450 #else | 1450 #else |
1451 Anchor = (struct AnchorPath *)alloc_clear(ANCHOR_SIZE); | 1451 Anchor = alloc_clear(ANCHOR_SIZE); |
1452 #endif | 1452 #endif |
1453 if (Anchor == NULL) | 1453 if (Anchor == NULL) |
1454 return 0; | 1454 return 0; |
1455 | 1455 |
1456 #ifndef __amigaos4__ | 1456 #ifndef __amigaos4__ |