src: replace typedef with using#38228
Conversation
addaleax
left a comment
There was a problem hiding this comment.
I would lean towards not doing this, given that this will give us merge conflicts and little benefit in return
| kSignPrivateKey, | ||
| kSignPublicKey, | ||
| kSignMalformedSignature | ||
| } Error; |
There was a problem hiding this comment.
This doesn't need to be typedef or using
There was a problem hiding this comment.
@addaleax I think we should we turn this into an enum class. A lot of its usage in crypto_sig.cc seems to precede the enumerations with Error:: except for a few instances.
There was a problem hiding this comment.
Yeah, both enum class or plain enum seem fine here
|
|
||
| #if !defined __cplusplus || (defined(_MSC_VER) && _MSC_VER < 1900) | ||
| typedef uint16_t char16_t; | ||
| using char16_t = uint16_t; |
| #pragma D depends_on library procfs.d | ||
|
|
||
| typedef struct { | ||
| using node_dtrace_connection_t = struct { |
There was a problem hiding this comment.
This is neither C nor C++ ... maybe keep this as-is?
| void* nm_priv; | ||
| void* reserved[4]; | ||
| } napi_module; | ||
| }; |
|
@addaleax I made this change because Lines 272 to 273 in 3377eb9 Should we still not go ahead with this PR? |
|
@RaisinTen I mean, that’s a good motivation for using |
|
@addaleax I think most of the PRs are functionality changes that don't cover parts of the code where aliases are declared. So will landing this change really have much of merge conflicts? Also, |
|
@RaisinTen I’m not blocking this :) I’d suggest squashing this down into a single commit and backporting that to the other release lines as soon as this lands, though. |
There was a problem hiding this comment.
The headers of node-api like js_native_api_types.h are C headers and should not use C++ features in it. Just marking the PR request for changes so that it will not be landed by accident. Please feel free to dismiss if updates are submitted regarding node-api part.
|
I'm generally -1 on changing all of these in bulk like this. I generally will only switch to using from typedef if there are other larger reflectors happening. As @addaleax mentions, doing it like this will cause pain with little benefit |
|
Thank you for the reviews. :) |
No description provided.