This repository has been archived by the owner on Nov 23, 2020. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tidy up cython extensions. No more py2 checks. Better dev version to …
…avoid warning in command line for #213 #release-note
- Loading branch information
Showing
11 changed files
with
35 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
|
||
cdef extern from "math.h": | ||
double log(double x) | ||
double sqrt(double x) | ||
|
||
|
||
cdef double clog2 = log(2.) | ||
|
||
cdef inline int int_max(int a, int b): return a if a >= b else b | ||
cdef inline int int_min(int a, int b): return a if a >= b else b | ||
|
||
|
||
# MSVC does not have log2! | ||
cdef inline double Log2(double x): | ||
return log(x) / clog2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
include "common.pyx" | ||
include "rparser.pyx" | ||
include "websocket.pyx" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
cdef extern from "websocket.h": | ||
object websocket_mask(const char* chunk, const char* key, | ||
size_t chunk_length, size_t mask_length) | ||
|
||
|
||
cdef inline bytes to_bytes(object value, str encoding): | ||
if isinstance(value, bytes): | ||
return value | ||
elif isinstance(value, str): | ||
return value.encode(encoding) | ||
else: | ||
raise TypeError('Requires bytes or string') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters