Skip to content

Instantly share code, notes, and snippets.

--- a/src/if_python3.c
+++ b/src/if_python3.c
@@ -203,6 +203,9 @@ typedef PySliceObject PySliceObject_T;
# define PySys_GetObject py3_PySys_GetObject
# define PySys_SetArgv py3_PySys_SetArgv
# define PyType_Ready py3_PyType_Ready
+# if PY_VERSION_HEX >= 0x03090000
+# define PyType_GetFlags py3_PyType_GetFlags
+# endif
#undef Py_BuildValue
@k-takata
k-takata / Makefile
Last active March 13, 2020 10:10
hashtable benchmark
all: khash_test.exe khash_test_strkey.exe st_test.exe st_test_strkey.exe
!if "$(Platform)"=="x64"
SIZEOF_VOIDP=8
!else
SIZEOF_VOIDP=4
!endif
khash_test.exe: khash_test.c khash.h
cl /O2 khash_test.c
let num = 1000000
let l = range(num)
let start = reltime()
call map(l, {-> v:val * 2})
echo start->reltime()->reltimestr()
let l = range(num)
let start = reltime()
call map(l, "v:val * 2")
@k-takata
k-takata / dl-ag.py
Created February 27, 2020 02:51
Download the latest silver searcher Win32 from the GitHub releases
#!/usr/bin/python3
# Download the latest silver searcher Win32 from the GitHub releases
import argparse
import calendar
import io
import json
import os
import sys
@k-takata
k-takata / dirlist0.vim
Last active February 7, 2020 02:46
Benchmark of Vim's readdir()
func! Dirlist(d = '.')
new
let start = reltime()
setlocal buftype=nofile
let list = readdir(a:d)
call append(line('$'), list)
call append(line('$'), reltimestr(reltime(start)))
endfunc
@echo off
rem Update the DLL using MSVC.
rem If the old DLL is in use, rename it to avoid compilation error.
rem current support version of Visual C compiler is 2012 or later.
rem
rem usage: update-dll-msvc
rem
rem
rem Sample .vimrc:
rem
@k-takata
k-takata / ln-mingw.sh
Last active May 11, 2022 02:54
Reduce the install size of clang, llvm, lld and gcc on MSYS2
#!/bin/sh
# Convert the same files into hard links to reduce the install size of
# clang, llvm, lld and gcc on MSYS2.
ESC=$'\33'
GREEN="$ESC[32m"
YELLOW="$ESC[33m"
CYAN="$ESC[36m"
RESET="$ESC[m"
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -1703,55 +1703,12 @@ mch_print_set_fg(long_u fgcol)
# include <shlobj.h>
# endif
-typedef enum _FILE_INFO_BY_HANDLE_CLASS_ {
- FileBasicInfo_,
- FileStandardInfo_,
- FileNameInfo_,
From 35b9dc6481422ed93236d2c201ff7da122c8ae26 Mon Sep 17 00:00:00 2001
From: "K.Takata" <kentkt@csc.jp>
Date: Thu, 13 Jun 2019 23:15:37 +0900
Subject: [PATCH] sound: Fix some issues
* Update document about sound_playevent() on Windows.
* Some lines exceeded 80 columns.
* Types of some variables were wrong.
---
runtime/doc/eval.txt | 11 ++++++++---
From 40542b0f2055df62819ba25f8e1aee623a20fb5d Mon Sep 17 00:00:00 2001
From: "K.Takata" <kentkt@csc.jp>
Date: Tue, 11 Jun 2019 19:22:56 +0900
Subject: [PATCH] MSVC: Update makefile for sound
---
src/Make_mvc.mak | 32 +++++++++++++++++++++++++-------
1 file changed, 25 insertions(+), 7 deletions(-)
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak