Changeset 443

Show
Ignore:
Timestamp:
06/28/07 07:07:14 (1 year ago)
Author:
athomas
Message:

Dev Todo:

  • A few bugfixes.
  • Added XML declaration parsing/saving. This is a stop-gap at best, but will
    hopefully be useful to some.
  • Removed reliance on builtin regex library. Hopefully the completely broken
    version of glibc that instigated the inclusion of it is now out of
    circulation.
  • Fixed a whole bunch of compiler warnings on more recent GCC versions.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • todo/trunk/ChangeLog

    r293 r443  
     10.1.20 
     2* A few bugfixes. 
     3* Added XML declaration parsing/saving. This is a stop-gap at best, but will 
     4  hopefully be useful to some. 
     5* Removed reliance on builtin regex library. Hopefully the completely broken 
     6  version of glibc that instigated the inclusion of it is now out of 
     7  circulation. 
     8* Fixed a whole bunch of compiler warnings on more recent GCC versions. 
     9 
    1100.1.19 
    211* Updated my E-Mail address after about a year of having the wrong one :) 
  • todo/trunk/src/Loaders.cc

    r292 r443  
    219219                if (options.verbose > 1) 
    220220                        cout << "todo: saving to database '" << file << "'" << endl; 
     221                of << "<?xml version=\"1.0\"?>" << endl; 
    221222                of << "<todo version=\"" << VERSION << "\">" << endl; 
    222223                if (todo.titleText != "") 
  • todo/trunk/src/main.cc

    r290 r443  
    1818int main(int argc, char const **argv) { 
    1919        // Initialise readline 
    20         rl_readline_name = PACKAGE
     20        rl_readline_name = const_cast<char*>(PACKAGE)
    2121        rl_initialize(); 
    2222 
  • todo/trunk/src/support.cc

    r290 r443  
    6161vector<string> keys = str::split(",", arg); 
    6262struct { 
    63         char *str; 
     63        const char *str; 
    6464        int key; 
    6565} table[] = { 
     
    742742        } 
    743743        if (c == 14) { 
    744                 rl_insert_text("\n"); 
     744                rl_insert_text(const_cast<char*>("\n")); 
    745745                return 0; 
    746746        } 
  • todo/trunk/src/.todo

    r290 r443  
    1 <!-- Automagically generated by the ToDo program on 05/05/03, 23:56 --
    2 <todo version="0.1.17"> 
     1<?xml version="1.0"?
     2<todo version="0.1.20"> 
    33    <note priority="medium" time="1052142714"> 
    44        Lalalalala 
     
    77        Blah blah 
    88    </note> 
     9    <note priority="medium" time="1183035293"> 
     10        Test 
     11    </note> 
     12    <note priority="medium" time="1183035381"> 
     13        foo 
     14    </note> 
    915</todo> 
  • todo/trunk/src/.todo.1

    r290 r443  
    1 <!-- Automagically generated by the ToDo program on 05/05/03, 23:56 --> 
    2 <todo version="0.1.17"> 
     1<todo version="0.1.20"> 
    32    <note priority="medium" time="1052142714"> 
    43        Lalalalala 
    54    </note> 
    6     <note priority="medium" time="1052142724"
     5    <note priority="medium" time="1052142724" done="1052143016"
    76        Blah blah 
    87    </note> 
     8    <note priority="medium" time="1183035293"> 
     9        Test 
     10    </note> 
    911</todo> 
  • todo/trunk/src/TodoDB.cc

    r292 r443  
    481481Todo::Priority TodoDB::getPriority(string current) 
    482482{ 
    483 char *pri[] = { 
     483const char *pri[] = { 
    484484        "veryhigh", 
    485485        "high", 
  • todo/trunk/src/todoterm.cc

    r290 r443  
    2929                term_initialized = true; 
    3030        } 
    31         return tgetnum("co"); 
     31        return tgetnum(const_cast<char*>("co")); 
    3232} 
    3333#else 
  • todo/trunk/.todo

    r293 r443  
     1<?xml version="1.0"?> 
    12<todo version="0.1.19"> 
    23    <title> 
  • todo/trunk/util/Makefile.am

    r290 r443  
    11noinst_LTLIBRARIES=libutil.la 
    2 libutil_la_SOURCES=c_regex.c c_regex.h Terminal.cc Terminal.h Lexer.cc Lexer.h \ 
     2libutil_la_SOURCES=Terminal.cc Terminal.h Lexer.cc Lexer.h \ 
    33        Regex.cc Regex.h XML.cc XML.h Strings.cc Strings.h CommandArgs.cc CommandArgs.h 
    44 
  • todo/trunk/util/Regex.h

    r290 r443  
    1010#include <cassert> 
    1111#include <sys/types.h> 
    12 #include "c_regex.h" 
     12#include <regex.h> 
    1313 
    1414#ifndef CRASH_REGEX_CACHE_THRESHOLD 
  • todo/trunk/util/Strings.cc

    r290 r443  
    9797string replace(string const &match, string const &repl, string const &in) { 
    9898string out; 
    99 unsigned found = 0, lastfound = 0; 
     99string::size_type found = 0, lastfound = 0; 
    100100 
    101101        while ((found = in.find(match, found)) != string::npos) { 
  • todo/trunk/util/XML.cc

    r340 r443  
    3737        Lexer::iterator i = xmlScan.begin(str); 
    3838 
     39                if (i.type() == XmlDecl) { 
     40                        ++i; 
     41                } 
    3942                parseElement(i); 
    4043        } catch (Lexer::exception &e) { 
     
    4649        // Only initialise scanners once 
    4750        if (!initialised) { 
     51                // <?xml version="1.0" encoding="UTF-8" standalone="no"?> 
     52                xmlScan.addPattern(XmlDecl, "<\\?xml.*?>[[:space:]]*"); 
    4853                xmlScan.addPattern(XmlCommentBegin, "<!--"); 
    4954                xmlScan.addPattern(XmlBegin, "<[a-zA-Z0-9_-]+" 
  • todo/trunk/util/XML.h

    r290 r443  
    6565 
    6666                // Lexer constants 
    67                 enum { XmlCommentBegin = 256, XmlBegin, XmlEnd, XmlDataBegin, XmlContent }; 
     67                enum { XmlDecl = 256, XmlCommentBegin, XmlBegin, XmlEnd, XmlDataBegin, XmlContent }; 
    6868                enum { ElementWS = 256, ElementValue, ElementKey, ElementAssignment, ElementTerminator}; 
    6969                enum { CommentEnd = 256,  CommentBody };