| 85 | } |
| 86 | |
| 87 | static int |
| 88 | insertNewVTFItem(VTFactoryObj *pVTFactory, |
| 89 | VTFactoryItemObj *pVTFI) |
| 90 | { |
| 91 | /* Ensure there is room for one more item in the array |
| 92 | * (safe to use for initial alloc of the array as well) |
| 93 | */ |
| 94 | if (pVTFactory->first_free == pVTFactory->size) { |
| 95 | int i; |
| 96 | VTFactoryItemObj **vtItemPtr; |
| 97 | vtItemPtr = (VTFactoryItemObj**)realloc(pVTFactory->vtItems, |
| 98 | (pVTFactory->size+MS_LAYER_ALLOCSIZE)*sizeof(VTFactoryItemObj*)); |
| 99 | MS_CHECK_ALLOC(vtItemPtr, (pVTFactory->size+MS_LAYER_ALLOCSIZE)*sizeof(VTFactoryItemObj*), MS_FAILURE); |
| 100 | |
| 101 | |
| 102 | pVTFactory->size += MS_LAYER_ALLOCSIZE; |
| 103 | pVTFactory->vtItems = vtItemPtr; |
| 104 | |
| 105 | for (i=pVTFactory->first_free; i<pVTFactory->size; i++) |
| 106 | pVTFactory->vtItems[i] = NULL; |
| 107 | } |
| 108 | |
| 109 | /* Insert item */ |
| 110 | pVTFactory->vtItems[pVTFactory->first_free] = pVTFI; |
| 111 | pVTFactory->first_free++; |
| 112 | |
| 113 | return MS_SUCCESS; |
| 114 | } |
| 115 | |
| 116 | static VTFactoryItemObj * |
| 117 | loadCustomLayerDLL(layerObj *layer, const char *library_path) |
no outgoing calls
no test coverage detected