@@ -88,7 +88,10 @@ constexpr char kPathSeparator = '/';
88
88
const char * const kPathSeparator = " \\ /" ;
89
89
#endif
90
90
91
- #define GET_OFFSET (a ) (IsSafeJsInt(a) ? (a).As<Integer>()->Value () : -1)
91
+ inline int64_t GetOffset (Local<Value> value) {
92
+ return IsSafeJsInt (value) ? value.As <Integer>()->Value () : -1 ;
93
+ }
94
+
92
95
#define TRACE_NAME (name ) " fs.sync." #name
93
96
#define GET_TRACE_ENABLED \
94
97
(*TRACE_EVENT_API_GET_CATEGORY_GROUP_ENABLED \
@@ -1681,7 +1684,7 @@ static void WriteBuffer(const FunctionCallbackInfo<Value>& args) {
1681
1684
CHECK_LE (len, buffer_length);
1682
1685
CHECK_GE (off + len, off);
1683
1686
1684
- const int64_t pos = GET_OFFSET (args[4 ]);
1687
+ const int64_t pos = GetOffset (args[4 ]);
1685
1688
1686
1689
char * buf = buffer_data + off;
1687
1690
uv_buf_t uvbuf = uv_buf_init (buf, len);
@@ -1721,7 +1724,7 @@ static void WriteBuffers(const FunctionCallbackInfo<Value>& args) {
1721
1724
CHECK (args[1 ]->IsArray ());
1722
1725
Local<Array> chunks = args[1 ].As <Array>();
1723
1726
1724
- int64_t pos = GET_OFFSET (args[2 ]);
1727
+ int64_t pos = GetOffset (args[2 ]);
1725
1728
1726
1729
MaybeStackBuffer<uv_buf_t > iovs (chunks->Length ());
1727
1730
@@ -1765,7 +1768,7 @@ static void WriteString(const FunctionCallbackInfo<Value>& args) {
1765
1768
CHECK (args[0 ]->IsInt32 ());
1766
1769
const int fd = args[0 ].As <Int32>()->Value ();
1767
1770
1768
- const int64_t pos = GET_OFFSET (args[2 ]);
1771
+ const int64_t pos = GetOffset (args[2 ]);
1769
1772
1770
1773
const auto enc = ParseEncoding (isolate, args[3 ], UTF8);
1771
1774
0 commit comments