diff --git a/native/cocos/audio/apple/AudioCache.mm b/native/cocos/audio/apple/AudioCache.mm index 1bee292f1d..f3ffe0ba4a 100644 --- a/native/cocos/audio/apple/AudioCache.mm +++ b/native/cocos/audio/apple/AudioCache.mm @@ -36,7 +36,8 @@ #define PCMDATA_CACHEMAXSIZE 1048576 -typedef ALvoid AL_APIENTRY (*alBufferDataStaticProcPtr) (const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq); +using alBufferDataStaticProcPtr = ALvoid AL_APIENTRY (*)(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq); + static ALvoid alBufferDataStaticProc(const ALint bid, ALenum format, ALvoid* data, ALsizei size, ALsizei freq) { static alBufferDataStaticProcPtr proc = NULL; diff --git a/native/cocos/base/CCMap.h b/native/cocos/base/CCMap.h index 02b7ed6c6b..098057b378 100644 --- a/native/cocos/base/CCMap.h +++ b/native/cocos/base/CCMap.h @@ -66,9 +66,9 @@ public: // ------------------------------------------ /** Iterator, can be used to loop the Map. */ - typedef typename RefMap::iterator iterator; + using iterator = typename RefMap::iterator; /** Const iterator, can be used to loop the Map. */ - typedef typename RefMap::const_iterator const_iterator; + using const_iterator = typename RefMap::const_iterator; /** Return iterator to beginning. */ iterator begin() { return _data.begin(); } diff --git a/native/cocos/base/CCVector.h b/native/cocos/base/CCVector.h index 8d1fe7f68d..7fe1f9cf6f 100644 --- a/native/cocos/base/CCVector.h +++ b/native/cocos/base/CCVector.h @@ -53,14 +53,14 @@ public: // ------------------------------------------ /** Iterator, can be used to loop the Vector. */ - typedef typename std::vector::iterator iterator; + using iterator = typename std::vector::iterator; /** Const iterator, can be used to loop the Vector. */ - typedef typename std::vector::const_iterator const_iterator; + using const_iterator = typename std::vector::const_iterator; /** Reversed iterator, can be used to loop the Vector in reverse sequence. */ - typedef typename std::vector::reverse_iterator reverse_iterator; + using reverse_iterator = typename std::vector::reverse_iterator; /** Reversed iterator, can be used to loop the Vector in reverse sequence. */ - typedef typename std::vector::const_reverse_iterator const_reverse_iterator; + using const_reverse_iterator = typename std::vector::const_reverse_iterator; /** Returns an iterator pointing the first element of the Vector. */ iterator begin() { return _data.begin(); } diff --git a/native/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp b/native/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp index bb4bd75755..97487fd8cb 100644 --- a/native/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp +++ b/native/cocos/editor-support/cocostudio/ActionTimeline/CCActionTimeline.cpp @@ -231,8 +231,7 @@ void ActionTimeline::step(float delta) } } -typedef std::function tCallBack; -void foreachNodeDescendant(Node* parent, tCallBack callback) +static void foreachNodeDescendant(Node* parent, std::function callback) { callback(parent);