C++ sptr_t type, and also uptr_t, means

What should the C++ sptr_t type, and uptr_t (if not misremember it) in Win32 API mean?
Sounds like implementations of a shared pointer and unique pointer.

They mean the code can be rewritten in C++ using std shared_ptr and standard unique_ptr.
Checking the internet I have found only one reference to those data types. Scintilla DLL use in Notepad++.

https://community.notepad-plus-plus.org/topic/13402/dll-hack-in-notepad

It certainly looks like a custom alias/template for C++ smart pointers.

Why the obfuscation? Too much effort to track down the reason.
not C++ smart pointers
the scintilla sptr_t/uptr_t are defined in Scintilla.h
(picking a random github mirror) https://github.com/pantelic-dusan/Scintilla-SciTE/blob/master/scintilla/include/Scintilla.h#L32-L35
1
2
3
4
// Define uptr_t, an unsigned integer type large enough to hold a pointer.
typedef uintptr_t uptr_t;
// Define sptr_t, a signed integer large enough to hold a pointer.
typedef intptr_t sptr_t;
Last edited on
Thanks.. Good news!
By you all have helped us sincerely, we have better Notepad++ !
click

https://github.com/abdulbadii/notepad-plus-minus
Topic archived. No new replies allowed.