mirror of
				https://github.com/nicbarker/clay.git
				synced 2025-11-03 16:16:18 +00:00 
			
		
		
		
	[Compilers] Fix integer truncation warnings with explicit casts
This commit is contained in:
		
						commit
						39fdd0e906
					
				
							
								
								
									
										6
									
								
								clay.h
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								clay.h
									
									
									
									
									
								
							| 
						 | 
					@ -1925,7 +1925,7 @@ void Clay__ConfigureOpenElementPtr(const Clay_ElementDeclaration *declaration) {
 | 
				
			||||||
                            .errorText = CLAY_STRING("A floating element was declared with a parentId, but no element with that ID was found."),
 | 
					                            .errorText = CLAY_STRING("A floating element was declared with a parentId, but no element with that ID was found."),
 | 
				
			||||||
                            .userData = context->errorHandler.userData });
 | 
					                            .userData = context->errorHandler.userData });
 | 
				
			||||||
                } else {
 | 
					                } else {
 | 
				
			||||||
                    clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, parentItem->layoutElement - context->layoutElements.internalArray);
 | 
					                    clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(parentItem->layoutElement - context->layoutElements.internalArray));
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            } else if (declaration->floating.attachTo == CLAY_ATTACH_TO_ROOT) {
 | 
					            } else if (declaration->floating.attachTo == CLAY_ATTACH_TO_ROOT) {
 | 
				
			||||||
                floatingConfig.parentId = Clay__HashString(CLAY_STRING("Clay__RootContainer"), 0, 0).id;
 | 
					                floatingConfig.parentId = Clay__HashString(CLAY_STRING("Clay__RootContainer"), 0, 0).id;
 | 
				
			||||||
| 
						 | 
					@ -3634,7 +3634,7 @@ uint32_t Clay_MinMemorySize(void) {
 | 
				
			||||||
    Clay__Context_Allocate_Arena(&fakeContext.internalArena);
 | 
					    Clay__Context_Allocate_Arena(&fakeContext.internalArena);
 | 
				
			||||||
    Clay__InitializePersistentMemory(&fakeContext);
 | 
					    Clay__InitializePersistentMemory(&fakeContext);
 | 
				
			||||||
    Clay__InitializeEphemeralMemory(&fakeContext);
 | 
					    Clay__InitializeEphemeralMemory(&fakeContext);
 | 
				
			||||||
    return fakeContext.internalArena.nextAllocation + 128;
 | 
					    return (uint32_t)fakeContext.internalArena.nextAllocation + 128;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
CLAY_WASM_EXPORT("Clay_CreateArenaWithCapacityAndMemory")
 | 
					CLAY_WASM_EXPORT("Clay_CreateArenaWithCapacityAndMemory")
 | 
				
			||||||
| 
						 | 
					@ -3687,7 +3687,7 @@ void Clay_SetPointerState(Clay_Vector2 position, bool isPointerDown) {
 | 
				
			||||||
            context->treeNodeVisited.internalArray[dfsBuffer.length - 1] = true;
 | 
					            context->treeNodeVisited.internalArray[dfsBuffer.length - 1] = true;
 | 
				
			||||||
            Clay_LayoutElement *currentElement = Clay_LayoutElementArray_Get(&context->layoutElements, Clay__int32_tArray_GetValue(&dfsBuffer, (int)dfsBuffer.length - 1));
 | 
					            Clay_LayoutElement *currentElement = Clay_LayoutElementArray_Get(&context->layoutElements, Clay__int32_tArray_GetValue(&dfsBuffer, (int)dfsBuffer.length - 1));
 | 
				
			||||||
            Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO think of a way around this, maybe the fact that it's essentially a binary tree limits the cost, but the worst case is not great
 | 
					            Clay_LayoutElementHashMapItem *mapItem = Clay__GetHashMapItem(currentElement->id); // TODO think of a way around this, maybe the fact that it's essentially a binary tree limits the cost, but the worst case is not great
 | 
				
			||||||
            int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, currentElement - context->layoutElements.internalArray);
 | 
					            int32_t clipElementId = Clay__int32_tArray_GetValue(&context->layoutElementClipElementIds, (int32_t)(currentElement - context->layoutElements.internalArray));
 | 
				
			||||||
            Clay_LayoutElementHashMapItem *clipItem = Clay__GetHashMapItem(clipElementId);
 | 
					            Clay_LayoutElementHashMapItem *clipItem = Clay__GetHashMapItem(clipElementId);
 | 
				
			||||||
            Clay_BoundingBox elementBox = mapItem->boundingBox;
 | 
					            Clay_BoundingBox elementBox = mapItem->boundingBox;
 | 
				
			||||||
            elementBox.x -= root->pointerOffset.x;
 | 
					            elementBox.x -= root->pointerOffset.x;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue