aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/mpm
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2006-02-17 18:21:29 +0000
committerrsc <devnull@localhost>2006-02-17 18:21:29 +0000
commit05f5d46b6368978fd22cfbea7155e983b0faa9a7 (patch)
treea56b09bd3124413746010a9ef5e803ea5b186d08 /src/cmd/mpm
parenteacea5a0647ba94a9d5906b2b4b7b5761bcef6e9 (diff)
downloadplan9port-05f5d46b6368978fd22cfbea7155e983b0faa9a7.tar.gz
plan9port-05f5d46b6368978fd22cfbea7155e983b0faa9a7.tar.bz2
plan9port-05f5d46b6368978fd22cfbea7155e983b0faa9a7.zip
make compile
Diffstat (limited to 'src/cmd/mpm')
-rw-r--r--src/cmd/mpm/mkfile3
-rw-r--r--src/cmd/mpm/range.h2
-rw-r--r--src/cmd/mpm/slug.cc14
3 files changed, 17 insertions, 2 deletions
diff --git a/src/cmd/mpm/mkfile b/src/cmd/mpm/mkfile
index 5c9df7d9..9a8a7f67 100644
--- a/src/cmd/mpm/mkfile
+++ b/src/cmd/mpm/mkfile
@@ -12,7 +12,8 @@ HFILES=misc.h\
LD=g++
<$PLAN9/src/mkone
-CFLAGS=
+CC=g++
+CFLAGS=-c
slug.$O: slug.h
range.$O: range.h slug.h
diff --git a/src/cmd/mpm/range.h b/src/cmd/mpm/range.h
index 401035a5..54994cdd 100644
--- a/src/cmd/mpm/range.h
+++ b/src/cmd/mpm/range.h
@@ -18,6 +18,7 @@ class range {
public:
range() { first = 0; accumV = 0; }
range(slug *p) { first = p; accumV = 0; }
+ virtual ~range() { }
char *headstr() {
return first ? first->headstr() : (char*)""; }
char *typename() { return first->typename(); }
@@ -307,6 +308,7 @@ class generator {
extern stream ptlist, btlist; // page titles
+#undef INFINITY
#define INFINITY 1000001
// A queue is a distinguished kind of stream.
diff --git a/src/cmd/mpm/slug.cc b/src/cmd/mpm/slug.cc
index b4ae0ff8..92d48db3 100644
--- a/src/cmd/mpm/slug.cc
+++ b/src/cmd/mpm/slug.cc
@@ -1,7 +1,6 @@
#include "misc.h"
#include "slug.h"
#include <math.h>
-#include <utf.h>
static char *bufptr(int);
@@ -149,6 +148,19 @@ static void adds(char *s)
addc(*p);
}
+static int fullrune(char *c, int n)
+{
+ if(n <= 0)
+ return 0;
+ if(n>=1 && (unsigned char)c[0] < 0x80)
+ return 1;
+ if(n>=2 && (unsigned char)c[0] < 0xE0)
+ return 1;
+ if(n>=3)
+ return 1;
+ return 0;
+}
+
static char *getutf(FILE *fp) // get 1 utf-encoded char (might be multiple bytes)
{
static char buf[100];