mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 16:52:43 +00:00 
			
		
		
		
	AK: Add global FlatPtr typedef. It's u32 or u64, based on sizeof(void*)
Use this instead of uintptr_t throughout the codebase. This makes it possible to pass a FlatPtr to something that has u32 and u64 overloads.
This commit is contained in:
		
							parent
							
								
									b98d8ad5b0
								
							
						
					
					
						commit
						b1058b33fb
					
				
					 36 changed files with 164 additions and 161 deletions
				
			
		|  | @ -77,7 +77,7 @@ void CppSyntaxHighlighter::highlight_matching_token_pair() | |||
|         bool forward = direction == Direction::Forward; | ||||
|         for (forward ? ++i : --i; forward ? (i < document.spans().size()) : (i >= 0); forward ? ++i : --i) { | ||||
|             auto& span = document.spans().at(i); | ||||
|             auto span_token_type = (CppToken::Type)((uintptr_t)span.data); | ||||
|             auto span_token_type = (CppToken::Type)((FlatPtr)span.data); | ||||
|             if (span_token_type == not_type) { | ||||
|                 ++nesting_level; | ||||
|             } else if (span_token_type == type) { | ||||
|  | @ -116,7 +116,7 @@ void CppSyntaxHighlighter::highlight_matching_token_pair() | |||
| 
 | ||||
|     for (size_t i = 0; i < document.spans().size(); ++i) { | ||||
|         auto& span = const_cast<GUI::TextDocumentSpan&>(document.spans().at(i)); | ||||
|         auto token_type = (CppToken::Type)((uintptr_t)span.data); | ||||
|         auto token_type = (CppToken::Type)((FlatPtr)span.data); | ||||
| 
 | ||||
|         for (auto& pair : pairs) { | ||||
|             if (token_type == pair.open && span.range.start() == m_editor->cursor()) { | ||||
|  |  | |||
|  | @ -138,7 +138,7 @@ void Layout::save_to(JsonObject& json) | |||
|         JsonObject entry_object; | ||||
|         if (entry.type == Entry::Type::Widget) { | ||||
|             entry_object.set("type", "Widget"); | ||||
|             entry_object.set("widget", (uintptr_t)entry.widget.ptr()); | ||||
|             entry_object.set("widget", (FlatPtr)entry.widget.ptr()); | ||||
|         } else if (entry.type == Entry::Type::Spacer) { | ||||
|             entry_object.set("type", "Spacer"); | ||||
|         } else { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling