ports/devel/doxygen/files/patch-md5
Li-Wen Hsu db926ec78e - Update to 1.6.2
PR:		ports/142201
Submitted by:	Naram Qashat <cyberbotx AT cyberbotx.com> (maintainer)
2010-01-01 12:53:37 +00:00

194 lines
6.5 KiB
Text

Every other package these days seems to come with its own MD5
implementation. Try to trim this insanity, where we can...
-mi
diff -ruN src/definition.cpp src/definition.cpp
--- src/definition.cpp.orig 2009-12-08 14:19:28.000000000 -0500
+++ src/definition.cpp 2009-12-31 11:52:30.000000000 -0500
@@ -18,6 +18,7 @@
#include "qtbc.h"
#include <ctype.h>
#include <qregexp.h>
+#include <sys/types.h>
#include <md5.h>
#include <stdio.h>
#include <stdlib.h>
@@ -364,13 +365,11 @@
bool Definition::_docsAlreadyAdded(const QCString &doc)
{
- uchar md5_sig[16];
QCString sigStr(33);
// to avoid mismatches due to differences in indenting, we first remove
// double whitespaces...
QCString docStr = doc.simplifyWhiteSpace();
- MD5Buffer((const unsigned char *)docStr.data(),docStr.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.data(),33);
+ MD5Data((const unsigned char *)docStr.data(),docStr.length(),sigStr.data());
if (m_impl->docSignatures.find(sigStr)==-1) // new docs, add signature to prevent re-adding it
{
m_impl->docSignatures+=":"+sigStr;
diff -ruN src/dirdef.cpp src/dirdef.cpp
--- src/dirdef.cpp.orig 2009-10-04 15:15:11.000000000 -0400
+++ src/dirdef.cpp 2009-12-31 11:55:59.000000000 -0500
@@ -1,3 +1,4 @@
+#include <sys/types.h>
#include <md5.h>
#include "dirdef.h"
@@ -74,10 +75,8 @@
QCString result;
// convert to md5 hash
- uchar md5_sig[16];
QCString sigStr(33);
- MD5Buffer((const unsigned char *)anchor.data(),anchor.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.data(),33);
+ MD5Data((const unsigned char *)anchor.data(),anchor.length(),sigStr.data());
return sigStr;
// old algorithm
diff -ruN src/dot.cpp src/dot.cpp
--- src/dot.cpp.orig 2009-10-10 06:50:28.000000000 -0400
+++ src/dot.cpp 2009-12-31 11:57:49.000000000 -0500
@@ -39,6 +39,7 @@
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
+#include <sys/types.h>
#include <md5.h>
#define MAP_CMD "cmapx"
@@ -1144,10 +1145,8 @@
}
writeGraphFooter(md5stream);
resetReNumbering();
- uchar md5_sig[16];
QCString sigStr(33);
- MD5Buffer((const unsigned char *)theGraph.ascii(),theGraph.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.data(),33);
+ MD5Data((const unsigned char *)theGraph.ascii(),theGraph.length(),sigStr.data());
if (checkAndUpdateMd5Signature(absBaseName,sigStr) ||
!QFileInfo(absMapName).exists())
{
@@ -1805,10 +1804,8 @@
}
}
writeGraphFooter(md5stream);
- uchar md5_sig[16];
QCString sigStr(33);
- MD5Buffer((const unsigned char *)buf.ascii(),buf.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.data(),33);
+ MD5Data((const unsigned char *)buf.ascii(),buf.length(),sigStr.data());
if (reNumber)
{
resetReNumbering();
diff -ruN src/doxygen.pro.in src/doxygen.pro.in
--- src/doxygen.pro.in.orig 2009-08-02 09:55:02.000000000 -0400
+++ src/doxygen.pro.in 2009-12-31 11:58:49.000000000 -0500
@@ -18,7 +18,7 @@
CONFIG = console warn_on $extraopts
HEADERS = doxygen.h
SOURCES = main.cpp
-unix:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lmd5
+unix:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lmd
win32:INCLUDEPATH += .
win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lmd5
win32-msvc:LIBS += qtools.lib md5.lib doxygen.lib doxycfg.lib shell32.lib iconv.lib
@@ -28,7 +28,7 @@
win32:TMAKE_CXXFLAGS += -DQT_NODLL
win32-g++:LIBS = -L../lib -ldoxygen -ldoxycfg -lqtools -lmd5 -liconv
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
-INCLUDEPATH += ../qtools ../libmd5 .
+INCLUDEPATH += ../qtools .
DESTDIR = ../bin
TARGET = doxygen
unix:TARGETDEPS = ../lib/libdoxygen.a ../lib/libdoxycfg.a
diff -ruN src/memberdef.cpp src/memberdef.cpp
--- src/memberdef.cpp.orig 2009-11-21 17:58:04.000000000 -0500
+++ src/memberdef.cpp 2009-12-31 12:00:03.000000000 -0500
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <qregexp.h>
+#include <sys/types.h>
#include <assert.h>
#include <md5.h>
#include "memberdef.h"
@@ -2516,10 +2517,8 @@
memAnchor.prepend(definition());
// convert to md5 hash
- uchar md5_sig[16];
QCString sigStr(33);
- MD5Buffer((const unsigned char *)memAnchor.data(),memAnchor.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.data(),33);
+ MD5Data((const unsigned char *)memAnchor.data(),memAnchor.length(),sigStr.data());
m_impl->anc = "a"+sigStr;
}
diff -ruN src/membergroup.cpp src/membergroup.cpp
--- src/membergroup.cpp.orig 2009-12-22 06:35:39.000000000 -0500
+++ src/membergroup.cpp 2009-12-31 12:01:18.000000000 -0500
@@ -261,10 +261,8 @@
QCString MemberGroup::anchor() const
{
- uchar md5_sig[16];
QCString sigStr(33);
- MD5Buffer((const unsigned char *)grpHeader.data(),grpHeader.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.data(),33);
+ MD5Data((const unsigned char *)grpHeader.data(),grpHeader.length(),sigStr.data());
return "amgrp"+sigStr;
}
diff -ruN src/util.cpp src/util.cpp
--- src/util.cpp.orig 2009-12-28 06:00:55.000000000 -0500
+++ src/util.cpp 2009-12-31 12:03:47.000000000 -0500
@@ -19,6 +19,7 @@
#include <ctype.h>
#include <errno.h>
+#include <sys/types.h>
#include <md5.h>
#include "qtbc.h"
@@ -4844,16 +4845,16 @@
if (resultLen>=128) // prevent names that cannot be created!
{
// third algorithm based on MD5 hash
- uchar md5_sig[16];
QCString sigStr(33);
- MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig);
- MD5SigToString(md5_sig,sigStr.data(),33);
+ MD5Data((const unsigned char *)result.data(),resultLen,sigStr.data());
result=result.left(128-32)+sigStr;
}
}
if (createSubdirs)
{
+#if MAP_ALGO==ALGO_COUNT || MAP_ALGO==ALGO_CRC16
int l1Dir=0,l2Dir=0;
+#endif
#if MAP_ALGO==ALGO_COUNT
// old algorithm, has the problem that after regeneration the
@@ -4884,12 +4885,13 @@
l2Dir = (dirNum>>4)&0xff;
#elif MAP_ALGO==ALGO_MD5
// third algorithm based on MD5 hash
- uchar md5_sig[16];
- MD5Buffer((const unsigned char *)result.data(),result.length(),md5_sig);
- l1Dir = md5_sig[14]&0xf;
- l2Dir = md5_sig[15];
+ char md5[33];
+ MD5Data((const unsigned char *)result.data(),result.length(),md5);
+ result.prepend(QCString().sprintf("d%c/d%c%c/",md5[29],md5[30],md5[31]));
#endif
+#if MAP_ALGO==ALGO_COUNT || MAP_ALGO==ALGO_CRC16
result.prepend(QCString().sprintf("d%x/d%02x/",l1Dir,l2Dir));
+#endif
}
//printf("*** convertNameToFile(%s)->%s\n",name,result.data());
return result;