Re: [hackers] Created od, with improvements suggested by FRIGN

2015-09-29 Thread Hiltjo Posthuma
On Tue, Sep 29, 2015 at 8:41 PM, Greg Reagle  wrote:
> My two patches combined with FRIGN's feedback.  See attached.
>

Nice work!



Re: [hackers] [dmenu] add a new dmenu option to trigger immediately when theres a single option left

2015-08-30 Thread Hiltjo Posthuma
On Sun, Aug 30, 2015 at 2:57 PM, Michael Stummvoll mich...@stummi.org wrote:
 From 12b254047d5f4fe0c254a3e686a36965ff50a266 Mon Sep 17 00:00:00 2001
 From: Michael Stummvoll mich...@stummi.org
 Date: Sun, 30 Aug 2015 14:49:51 +0200
 Subject: [PATCH] Introduce instant match option

 with the instant match option, dmenu will close as soon as there is a
 distinct match for the current input.

 The default behavior will be defined in the config.def.h with the
 instant option. The -n flag will toggle the default behavior.
 ---

Hi,

The patch seems garbled / linewrapped to me.

I won't add this feature to upstream dmenu though, feel free to upload
this to the suckless site however:
http://git.suckless.org/sites/tree/tools.suckless.org/dmenu/patches

Kind regards,
HIltjo



Re: [hackers] [dmenu] [PATCH] Typo Patch

2015-08-06 Thread Hiltjo Posthuma
On Thu, Aug 6, 2015 at 4:20 AM, Eric Pruitt eric.pru...@gmail.com wrote:
 This patch fixes a typo in dmenu.


Hi!

Applied! Thanks for the patch.

Kind regards,
Hiltjo



Re: [hackers] [scc][patch] fix build + some whitespace fixes

2015-07-17 Thread Hiltjo Posthuma
On Fri, Jul 17, 2015 at 8:34 PM, Eric Pruitt eric.pru...@gmail.com wrote:

 You forgot the attachments.

Lol, sorry, again:

patch 1: whitespace fixes
patch 2: make fp of type FILE * and use needed includes
patch 3: fix missing ;
From fdcb684addcb71b6067b6668bd0e723277e22544 Mon Sep 17 00:00:00 2001
From: Hiltjo Posthuma hil...@codemadness.org
Date: Fri, 17 Jul 2015 20:28:56 +0200
Subject: [PATCH 1/3] whitespace fixes

---
 cc1/cc1.h |  1 -
 cc1/cpp.c | 26 +-
 2 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/cc1/cc1.h b/cc1/cc1.h
index 7095cf2..6a9d9aa 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
@@ -13,7 +13,6 @@ typedef struct caselist Caselist;
 typedef struct node Node;
 typedef struct input Input;
 
-
 struct type {
unsigned char op;   /* type builder operator */
unsigned char ns;
diff --git a/cc1/cpp.c b/cc1/cpp.c
index 534585a..3e10e2e 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -59,17 +59,17 @@ icpp(void)
 static void
 nextcpp(void)
 {
-next();
-if (yytoken == EOFTOK)
+   next();
+   if (yytoken == EOFTOK)
error(unterminated argument list invoking macro \%s\,
-  macroname);
-if (yylen + 1  arglen)
-error(argument overflow invoking macro \%s\,
-  macroname);
-memcpy(argp, yytext, yylen);
-argp += yylen;
-*argp++ = ' ';
-arglen -= yylen + 1;
+ macroname);
+   if (yylen + 1  arglen)
+   error(argument overflow invoking macro \%s\,
+ macroname);
+   memcpy(argp, yytext, yylen);
+   argp += yylen;
+   *argp++ = ' ';
+   arglen -= yylen + 1;
 }
 
 static void
@@ -171,7 +171,7 @@ copymacro(char *bp, char *s, size_t bufsiz, char *arglist[])
s += 2;
}
}
-*bp = '\0';
+   *bp = '\0';
 
return;
 
@@ -201,8 +201,8 @@ expand(char *begin, Symbol *sym)
macroname = sym-name;
if (!parsepars(arguments, arglist, atoi(s)))
return 0;
-for (n = 0; n  atoi(s); ++n)
-fprintf(stderr, PAR%d:%s\n, n, arglist[n]);
+   for (n = 0; n  atoi(s); ++n)
+   fprintf(stderr, PAR%d:%s\n, n, arglist[n]);
 
copymacro(buffer, s+3, INPUTSIZ-1, arglist);
 
-- 
2.3.0

From 88eb60a95be178120f204bc80d6a011cece4522b Mon Sep 17 00:00:00 2001
From: Hiltjo Posthuma hil...@codemadness.org
Date: Fri, 17 Jul 2015 20:29:28 +0200
Subject: [PATCH 2/3] make fp of type FILE * and use needed includes

---
 cc1/cc1.h| 2 +-
 cc1/decl.c   | 1 +
 cc1/symbol.c | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/cc1/cc1.h b/cc1/cc1.h
index 6a9d9aa..5a18e21 100644
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
@@ -73,7 +73,7 @@ struct yystype {
 
 struct input {
char *fname;
-   void *fp;
+   FILE *fp;
char *line, *begin, *p;
struct input *next;
unsigned short nline;
diff --git a/cc1/decl.c b/cc1/decl.c
index 9d6ff98..ded6ee4 100644
--- a/cc1/decl.c
+++ b/cc1/decl.c
@@ -1,6 +1,7 @@
 
 #include inttypes.h
 #include setjmp.h
+#include stdio.h
 #include string.h
 
 #include ../inc/sizes.h
diff --git a/cc1/symbol.c b/cc1/symbol.c
index 57eb7ac..c869cd6 100644
--- a/cc1/symbol.c
+++ b/cc1/symbol.c
@@ -1,5 +1,6 @@
 
 #include inttypes.h
+#include stdio.h
 #include stdlib.h
 #include string.h
 
-- 
2.3.0

From a81a19be94c21fffa5b92aeb6bd484f50f5e62c0 Mon Sep 17 00:00:00 2001
From: Hiltjo Posthuma hil...@codemadness.org
Date: Fri, 17 Jul 2015 20:29:58 +0200
Subject: [PATCH 3/3] fix missing ;

---
 cc1/cpp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c
index 3e10e2e..4df8244 100644
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -447,7 +447,7 @@ ifclause(int isdef)
 
if (cppctx == NR_COND-1)
error(too much nesting levels of conditional inclusion);
-   n = cppctx++
+   n = cppctx++;
if (yytoken != IDEN) {
error(no macro name given in #%s directive,
  (isdef) ? ifdef : ifndef);
-- 
2.3.0



Re: [hackers] Re: [dmenu] Use libsl/libdraw code and add Xft support

2015-06-28 Thread Hiltjo Posthuma
On Sat, Jun 27, 2015 at 9:50 PM, Anselm R Garbe garb...@gmail.com wrote:

 You are very welcome to take over libsl+dmenu. But I'd like to keep
 the dwm maintainership, though all plans back from 2013 are still
 valid. If you keep working on libsl+dmenu, I'd be willing to
 adopt/adjust dwm accordingly for the next 6.1 release.


Awesome! I have some (small) changes for libsl and dmenu in queue. I
will post it within a few days.

Can you provide the permissions and PM the details to push to dmenu (and libsl)?

Kind regards,
Hiltjo



[hackers] Re: [dmenu] Use libsl/libdraw code and add Xft support

2015-06-12 Thread Hiltjo Posthuma
On Mon, Jun 8, 2015 at 11:48 PM, Hiltjo Posthuma hil...@codemadness.org wrote:
 On Mon, Jun 8, 2015 at 11:05 PM, Hiltjo Posthuma hil...@codemadness.org 
 wrote:
 ... snip ...



Some more thoughts: in drw.c these functions don't check if drw ==
NULL before use: drw_load_fonts, drw_font_xcreate.

We should probably not check these in drw.c and let the program using
drw error out at drw_create(). If an invalid context is passed it
should just crash. This would make spotting errors regarding drw.{c,h}
simpler aswell.

Kind regards,
Hiltjo



[hackers] Re: [dmenu] Use libsl/libdraw code and add Xft support

2015-06-08 Thread Hiltjo Posthuma
On Mon, Jun 8, 2015 at 11:05 PM, Hiltjo Posthuma hil...@codemadness.org wrote:
 ... snip ...


I forgot to mention I also changed the odd case in drw_cur_create
where if you pass NULL for drw it would allocate memory but never
expose it and return NULL (possible leak):
http://git.suckless.org/dwm/tree/drw.c#n397 .

Also on OpenBSD I got a warning for a possible case for uninitialised
variable in drw.c drw_text(): XftDraw *d . I looked into this, but I
think this is a false positive and didn't change it.



Re: [hackers] [sbase] config.mk: make cc the default $CC || Hiltjo Posthuma

2014-11-11 Thread Hiltjo Posthuma
On Tue, Nov 11, 2014 at 11:05 AM, Dimitris Papastamos s...@2f30.org wrote:

 I agree on this, I think Hiltjo had some trouble because it
 was defaulting to c99 as opposed to cc and that did not
 exist on his system.

 Hiltjo, can you clarify again?


Yeah that was my problem. .POSIX: in the Makefile specifies c99 is
the default $CC[0]. That said I'll just fix my system. Feel free to
revert this commit.

[0]: http://pubs.opengroup.org/onlinepubs/007904975/utilities/make.html



<    1   2   3   4   5