Skip to contentSkip to conversation

Documentation/core-api: min_heap: update for variable types change

PATCH Applied Yu-Chun Lin 3 participants 3 messages Feb 15, 2025 – Feb 18, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Documentation/core-api: min_heap: update for variable types change

Update the documentation to reflect the change in variable types of 'nr' and 'size' from 'int' to 'size_t', ensuring consistency with commit dec6c0aac4fc ("lib min_heap: Switch to size_t").

---
 Documentation/core-api/min_heap.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/core-api/min_heap.rst +2 -2
index 683bc6d09f00..9f57766581df 100644
@@ -47,8 +47,8 @@ Example:
 
     #define MIN_HEAP_PREALLOCATED(_type, _name, _nr)
     struct _name {
-        int nr;         /* Number of elements in the heap */
-        int size;       /* Maximum number of elements that can be held */
+        size_t nr;         /* Number of elements in the heap */
+        size_t size;       /* Maximum number of elements that can be held */
         _type *data;    /* Pointer to the heap data */
         _type preallocated[_nr];  /* Static preallocated array */
     }
Signature · 1 line
2.43.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Yu-Chun Lin

Update the documentation to reflect the change in variable types of 'nr' and 'size' from 'int' to 'size_t', ensuring consistency with commit dec6c0aac4fc ("lib min_heap: Switch to size_t").

LGTM. Thanks for the patch.

This reminds me that I have a patch to change 'int' to 'size_t' for indexes in min_heap.h, but it hasn't been merged yet. I'll find it and resend it.

Regards,
Kuan-Wei

maintainer Applied
#2 lore raw
In reply to Yu-Chun Lin
Quoted 14 lines · Yu-Chun Lin

Update the documentation to reflect the change in variable types of 'nr' and 'size' from 'int' to 'size_t', ensuring consistency with commit dec6c0aac4fc ("lib min_heap: Switch to size_t").

---
 Documentation/core-api/min_heap.rst | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Documentation/core-api/min_heap.rst +0 -0
index 683bc6d09f00..9f57766581df 100644

Documentation/core-api/min_heap.rst Example: · line 52

Quoted 8 lines
Documentation/core-api/min_heap.rst +2 -2
@@ -47,8 +47,8 @@ Example:
 
     #define MIN_HEAP_PREALLOCATED(_type, _name, _nr)
     struct _name {
-        int nr;         /* Number of elements in the heap */
-        int size;       /* Maximum number of elements that can be held */
+        size_t nr;         /* Number of elements in the heap */
+        size_t size;       /* Maximum number of elements that can be held */
         _type *data;    /* Pointer to the heap data */

Applied, thanks.

jon