[hackers] [libzahl] Fix errors in the manual (most of them found by Ivan Zuboff) || Mattias Andrée
commit aeb5e44a98cb4158528206c079654357b1c75b16 Author: Mattias Andrée AuthorDate: Wed Nov 30 10:15:59 2016 +0100 Commit: Mattias Andrée CommitDate: Wed Nov 30 10:15:59 2016 +0100 Fix errors in the manual (most of them found by Ivan Zuboff) Signed-off-by: Mattias Andrée diff --git a/doc/exercises.tex b/doc/exercises.tex index 3a9df19..9a18b99 100644 --- a/doc/exercises.tex +++ b/doc/exercises.tex @@ -596,7 +596,7 @@ ptest_llt(z_t n) $M_n$ is composite if $n$ is composite, therefore, if you do not expect prime-only values on $n$, the -performance can be improve by using some other +performance can be improved by using some other primality test (or this same test if $n$ is a Mersenne number) to first check that $n$ is prime. diff --git a/doc/miscellaneous.tex b/doc/miscellaneous.tex index 8750595..420d6a7 100644 --- a/doc/miscellaneous.tex +++ b/doc/miscellaneous.tex @@ -101,7 +101,7 @@ sum of a set of numbers. Another form of assignment available in libzahl is copy-assignment. This done using {\tt zset}. As easily observable, {\tt zset} is named like -{\tt zseti}, {\tt zsetu}, and {\tt zsetu}, but +{\tt zseti}, {\tt zsetu}, and {\tt zsets}, but without the input-type suffix. The lack of a input-type suffix means that the input type is {\tt z\_t}. {\tt zset} copies value of second diff --git a/doc/not-implemented.tex b/doc/not-implemented.tex index 59b3efb..9688189 100644 --- a/doc/not-implemented.tex +++ b/doc/not-implemented.tex @@ -3,25 +3,25 @@ In this chapter we maintain a list of features we have chosen not to implement, -but would fit into libzahl had we not have +but would fit into libzahl, had we not have our priorities straight. Functions listed herein will only be implemented if it is shown that it would be overwhelmingly advantageous. For each feature, a sample implementation or a mathematical expression -on which you can base your implemention -is included. The sample implementations create -temporary integer references, this is to -simplify the examples. You should try to -use dedicated variables; in case of recursion, -a robust program should store temporary -variables on a stack, so they can be -clean up if something happens. - -Research problems, like prime-factorisation -and discrete logarithms do not fit in the -scope of bignum libraries. % Unless they are extraordinarily bloated with vague mission-scope, like systemd. -And therefore do not fit into libzahl, +on which you can base your implementation is +included. The sample implementations create +temporary integer references to simplify the +examples. You should try to use dedicated +variables; in case of recursion, a robust +program should store temporary variables on +a stack, so they can be cleaned up if +something happens. + +Research problems, like prime factorisation +and discrete logarithms, do not fit in the +scope of bignum libraries % Unless they are extraordinarily bloated with vague mission-scope, like systemd. +and therefore do not fit into libzahl, and will not be included in this chapter. Operators and functions that grow so ridiculously fast that a tiny lookup table @@ -330,7 +330,7 @@ method can be derived from the observation \vspace{1em} \noindent -The resulting algorithm can be expressed +The resulting algorithm can be expressed as \begin{alltt} void @@ -690,10 +690,10 @@ in an integer, counting the sign bit: \end{alltt} \noindent -It requires a compiler extension, if missing, -there are other ways to computer the population -count for a word: manually bit-by-bit, or with -a fully unrolled +It requires a compiler extension; if it's not +available, there are other ways to computer the +population count for a word: manually bit-by-bit, +or with a fully unrolled \begin{alltt} int s; @@ -706,7 +706,7 @@ a fully unrolled \label{sec:Hamming distance} A simple way to compute the Hamming distance, -the number of differing bits, between two +the number of differing bits between two numbers is with the function \begin{alltt} @@ -767,13 +767,13 @@ side-effects. \label{sec:Reference duplication} This could be useful for creating duplicates -with modified sign. But only if neither +with modified sign, but only if neither {\tt r} nor {\tt a} will be modified whilst both are in use. Because it is unsafe, fairly simple to create an implementation with acceptable performance â {\tt *r = *a}, â and probably seldom useful, this has not -be implemented. +been implemented. \begin{alltt} void diff --git a/doc/number-theory.tex b/doc/number-theory.tex index 10c485b..b4c2ece 100644 --- a/doc/number-theory.tex +++ b/doc/number-theory.tex @@ -145,7 +145,7 @@ definion ensures \noindent and analogously for $\frac{b}{\gcd(a,\,b)}$. Note however, the convension $\gcd(0, 0) = 0$ is adhered. Therefore, -before dividing with $\gcd{a, b}$ you may want to check +before dividing with $\gcd(a, b)$ you may want to check whether $\gcd(a, b) = 0$.
[hackers] [libzahl] Fix errors in the manual found by Ivan Zuboff || Mattias Andrée
commit cf4b5d338225ac30d8f7434768c45619928bf3bf Author: Mattias Andrée AuthorDate: Wed Nov 30 10:55:09 2016 +0100 Commit: Mattias Andrée CommitDate: Wed Nov 30 10:55:09 2016 +0100 Fix errors in the manual found by Ivan Zuboff Signed-off-by: Mattias Andrée diff --git a/doc/not-implemented.tex b/doc/not-implemented.tex index 9688189..cbf1355 100644 --- a/doc/not-implemented.tex +++ b/doc/not-implemented.tex @@ -2,11 +2,12 @@ \label{chap:Not implemented} In this chapter we maintain a list of -features we have chosen not to implement, -but would fit into libzahl, had we not have -our priorities straight. Functions listed -herein will only be implemented if it is -shown that it would be overwhelmingly +features we have chosen not to implement at +the moment, but may add when libzahl matures, +but to a separate library that could be made +to support multiple bignum libraries. Functions +listed herein will only be implemented if it +is shown that it would be overwhelmingly advantageous. For each feature, a sample implementation or a mathematical expression on which you can base your implementation is @@ -25,9 +26,9 @@ and therefore do not fit into libzahl, and will not be included in this chapter. Operators and functions that grow so ridiculously fast that a tiny lookup table -constructed to cover all practical input -will also not be included in this chapter, -nor in libzahl. +can be constructed to cover all practical +input will also not be included in this +chapter, nor in libzahl. \vspace{1cm} \minitoc diff --git a/doc/number-theory.tex b/doc/number-theory.tex index b4c2ece..889d111 100644 --- a/doc/number-theory.tex +++ b/doc/number-theory.tex @@ -208,7 +208,7 @@ It is certain that {\tt a} is not prime. If and only if {\tt NONPRIME} is returned, a value will be assigned to {\tt w} â unless {\tt w} is {\tt NULL}. This will be the witness -of {\tt a}'s completeness. If $a \le 2$, it +of {\tt a}'s completeness. If $a \le 1$, it is not really composite, and the value of {\tt a} is copied into {\tt w}.
[hackers] [scc] [cc2] Fix the order of elements of decl || Roberto E. Vargas Caballero
commit 821f4c28e2e9ae7404e87b9e04047b5273dfda1b Author: Roberto E. Vargas Caballero AuthorDate: Wed Nov 30 14:11:48 2016 +0100 Commit: Roberto E. Vargas Caballero CommitDate: Wed Nov 30 14:11:48 2016 +0100 [cc2] Fix the order of elements of decl The aligment and the size were reversed parsing the IR from cc1. diff --git a/cc2/parser.c b/cc2/parser.c index b9847eb..34921c3 100644 --- a/cc2/parser.c +++ b/cc2/parser.c @@ -500,8 +500,8 @@ aggregate(void) Type *tp; Symbol *sym; - align = pop(); size = pop(); + align = pop(); name = pop(); tp = pop();
[hackers] [sxiv] Ignore button and key events while key-handler is running || Bert Münnich
commit 9a85dd41d8551f82a5d00c8e0dd0807e23bbdc6d Author: Bert Münnich AuthorDate: Tue Nov 29 12:07:08 2016 +0100 Commit: Bert Münnich CommitDate: Wed Nov 30 20:48:32 2016 +0100 Ignore button and key events while key-handler is running Related to issue #253, which originally asked for a non-blocking key-handler. diff --git a/Makefile b/Makefile index 07fff5e..3db5ade 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -VERSION := git-20161128 +VERSION := git-20161129 PREFIX:= /usr/local MANPREFIX := $(PREFIX)/share/man diff --git a/main.c b/main.c index d1813a5..131fdec 100644 --- a/main.c +++ b/main.c @@ -458,6 +458,11 @@ void clear_resize(void) resized = false; } +Bool is_input_ev(Display *dpy, XEvent *ev, XPointer arg) +{ + return ev->type == ButtonPress || ev->type == KeyPress; +} + void run_key_handler(const char *key, unsigned int mask) { pid_t pid; @@ -468,6 +473,7 @@ void run_key_handler(const char *key, unsigned int mask) int fcnt = marked ? markcnt : 1; char kstr[32]; struct stat *oldst, st; + XEvent dump; if (keyhandler.f.err != 0) { if (!keyhandler.warned) { @@ -538,6 +544,9 @@ void run_key_handler(const char *key, unsigned int mask) f++; } } + /* drop user input events that occured while running the key handler */ + while (XCheckIfEvent(win.env.dpy, &dump, is_input_ev, NULL)); + end: if (mode == MODE_IMAGE) { if (changed) {
[hackers] [dwm][PATCH] clarify tile layout description in man page
--- dwm.1 | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dwm.1 b/dwm.1 index 60ca1d6..e3b2c38 100644 --- a/dwm.1 +++ b/dwm.1 @@ -10,8 +10,9 @@ and floating layouts. Either layout can be applied dynamically, optimising the environment for the application in use and the task performed. .P In tiled layouts windows are managed in a master and stacking area. The master -area contains the window which currently needs most attention, whereas the -stacking area contains all other windows. In monocle layout all windows are +area on the left contains one window by default, and the stacking area on the +right contains all other windows. The number of master area windows can be +adjusted from zero to an arbitrary number. In monocle layout all windows are maximised to the screen size. In floating layout windows can be resized and moved freely. Dialog windows are always managed floating, regardless of the layout applied. @@ -98,10 +99,10 @@ Focus next window. Focus previous window. .TP .B Mod1\-i -Increase clients in master area. +Increase number of windows in master area. .TP .B Mod1\-d -Decrease clients in master area. +Decrease number of windows in master area. .TP .B Mod1\-l Increase master area size. -- 2.10.2
Re: [hackers] [dwm] [PATCH] support the NET_SUPPORTING_WM_CHECK EWMH property
On Sat, Nov 26, 2016 at 08:00:01AM +0100, Ivan Delalande wrote: > This is mostly arg's 762b66a resurrected ("hack that adds > NET_SUPPORTING_WM_CHECK handling..."), but we have to create a dedicated > window which remains unmapped as bar windows can now be destroyed at any > time with their monitor. Is this patch going to be merged? Eric
[hackers] [sbase] [PATCH] parsemode: No need to return after eprintf
Also, since parsemode exits on failure, don't bother checking return value in xinstall (this would never trigger anyway because mode_t can be unsigned). --- libutil/mode.c | 6 ++ xinstall.c | 5 + 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/libutil/mode.c b/libutil/mode.c index 365b9ad..187c7a3 100644 --- a/libutil/mode.c +++ b/libutil/mode.c @@ -1,3 +1,4 @@ +/* See LICENSE file for copyright and license details. */ #include #include #include @@ -23,10 +24,8 @@ parsemode(const char *str, mode_t mode, mode_t mask) octal = strtol(str, &end, 8); if (*end == '\0') { - if (octal < 0 || octal > 0) { + if (octal < 0 || octal > 0) eprintf("%s: invalid mode\n", str); - return -1; - } mode = 0; if (octal & 04000) mode |= S_ISUID; if (octal & 02000) mode |= S_ISGID; @@ -78,7 +77,6 @@ next: break; default: eprintf("%s: invalid mode\n", str); - return -1; } perm = 0; diff --git a/xinstall.c b/xinstall.c index bf921fb..70d7097 100644 --- a/xinstall.c +++ b/xinstall.c @@ -215,11 +215,8 @@ main(int argc, char *argv[]) owner = getuid(); } - if (mflag) { + if (mflag) mode = parsemode(mflag, mode, 0); - if (mode < 0) - return 1; - } if (tflag) { memmove(argv - 1, argv, argc); -- 2.10.2