From ff7b46743fdcbc5ce956e98f68bbd16dc5ed6e3b Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Sun, 17 Aug 2014 15:47:12 -0400
Subject: [PATCH] Reorganize some code to support building with clang. Closes:
 #758450 Thanks, Alexander.

---
 cockney.l        | 27 +++++++++++++++++----------
 debian/changelog |  7 +++++++
 jive.l           | 13 +++++++++----
 nyc.l            | 15 +++++++--------
 4 files changed, 40 insertions(+), 22 deletions(-)

diff --git a/cockney.l b/cockney.l
index f6d0ad2..4cc1555 100644
--- a/cockney.l
+++ b/cockney.l
@@ -15,19 +15,13 @@ EW [ \t.,;!\?$]
 
 %Start junk
 
+%option noyywrap
+
 %%
 
 %{
-	void eos() {
-	    if (yytext[yyleng-1] == '.')
-		dintI();
-	    else
-		unput(yytext[yyleng-1]);
-	}
-
-	void plastc() {
-	    unput(yytext[yyleng-1]);
-	}
+void eos();
+void plastc();
 %}
 
 <junk>.			{	srandom(time(0L)); unput(yytext[0]); BEGIN 0; }
@@ -103,6 +97,19 @@ ime{EW}			{	printf("oime"); eos(); }
 
 %%
 
+void eos()
+{
+    if (yytext[yyleng-1] == '.')
+    dintI();
+    else
+    unput(yytext[yyleng-1]);
+}
+
+void plastc()
+{
+    unput(yytext[yyleng-1]);
+}
+
 caseify(c)
 char c;
 {
diff --git a/debian/changelog b/debian/changelog
index 1af2543..eb4c118 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+filters (2.50) UNRELEASED; urgency=medium
+
+  * Reorganize some code to support building with clang.
+    Closes: #758450 Thanks, Alexander.
+
+ -- Joey Hess <joeyh@debian.org>  Sun, 17 Aug 2014 15:46:17 -0400
+
 filters (2.49) unstable; urgency=low
 
   * scottish: Fix typo. Closes: #688905
diff --git a/jive.l b/jive.l
index 1171975..f8a1386 100644
--- a/jive.l
+++ b/jive.l
@@ -17,13 +17,13 @@
 %o 1500
 BW [ \t\(]
 EW [ \t.,;!\?$\)]
+%option noyywrap
 %%
+
 %{
-	void plastc()
-	{
-		unput(yytext[yyleng-1]);
-	}
+    void plastc();
 %}
+
 @[Bb]egin(.*)		|
 ".so ".*$			printf("%s", yytext);
 {BW}send			printf("%ct'row",yytext[0]);
@@ -202,6 +202,11 @@ meta				printf("meta-fuckin'");
 cally				printf("c'l");
 %%
 
+void plastc()
+{
+    unput(yytext[yyleng-1]);
+}
+
 caseify(c)
 char c;
 {
diff --git a/nyc.l b/nyc.l
index b00f2b0..509979e 100644
--- a/nyc.l
+++ b/nyc.l
@@ -11,11 +11,10 @@
 BW [ \t]
 SP [ \t]
 EW [ \t.,;!\?$]
+
 %%
 %{
-	void plastc() {
-		yyunput(yytext[yyleng-1], yytext);
-	}
+    void plastc();
 %}
 ".so ".*$			printf("%s", yytext);
 [ao]ther			printf("%cdder", yytext[0]=='a'?'a':'u');
@@ -72,6 +71,11 @@ negro				printf("spade");
 [a-z]"."		{	printf("%s", yytext);expletive();}
 %%
 
+void plastc()
+{
+    yyunput(yytext[yyleng-1], yytext);
+}
+
 caseify(c)
 char c;
 {
@@ -97,11 +101,6 @@ expletive()
 		}
 }
 
-main()
-{
-	yylex();
-}
-
 int yywrap()
 {
 	return 1;
-- 
2.39.5