mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 05:58:33 +00:00
macro: Add MAX macro and rename min to MIN
This commit is contained in:
@@ -287,7 +287,7 @@ MsgpackRpcRequestHandler msgpack_rpc_get_handler_for(const char *name,
|
||||
{
|
||||
String m = {
|
||||
.data=(char *)name,
|
||||
.size=min(name_len, ]]..max_fname_len..[[)
|
||||
.size=MIN(name_len, ]]..max_fname_len..[[)
|
||||
};
|
||||
MsgpackRpcRequestHandler rv =
|
||||
map_get(String, MsgpackRpcRequestHandler)(methods, m);
|
||||
|
@@ -100,7 +100,7 @@ static inline khint_t String_hash(String s)
|
||||
|
||||
static inline bool String_eq(String a, String b)
|
||||
{
|
||||
return strncmp(a.data, b.data, min(a.size, b.size)) == 0;
|
||||
return strncmp(a.data, b.data, MIN(a.size, b.size)) == 0;
|
||||
}
|
||||
|
||||
|
||||
|
@@ -8,7 +8,8 @@
|
||||
#ifndef NVIM_VIM_H
|
||||
# define NVIM_VIM_H
|
||||
|
||||
#define min(X, Y) (X < Y ? X : Y)
|
||||
#define MIN(X, Y) (X < Y ? X : Y)
|
||||
#define MAX(X, Y) (X > Y ? X : Y)
|
||||
|
||||
#include "nvim/types.h"
|
||||
#include "nvim/pos.h" // for linenr_T, MAXCOL, etc...
|
||||
|
Reference in New Issue
Block a user