View | Details | Raw Unified | Return to bug 256249
Collapse All | Expand All

(-)b/games/hllib/Makefile (-12 / +6 lines)
Lines 1-12 Link Here
1
# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
1
# Created by: Alexey Dokuchaev <danfe@FreeBSD.org>
2
2
3
PORTNAME=	hllib
3
PORTNAME=	hllib
4
PORTVERSION=	2.4.4
4
PORTVERSION=	2.4.6
5
CATEGORIES=	games devel
5
CATEGORIES=	games devel
6
MASTER_SITES=	LOCAL/danilo
6
MASTER_SITES=	https://github.com/osen/distfiles/raw/main/
7
DISTNAME=	${PORTNAME}${PORTVERSION:S/.//g}
7
DISTNAME=	${PORTNAME}${PORTVERSION:S/.//g}
8
8
9
MAINTAINER=	ports@FreeBSD.org
9
MAINTAINER=	kpedersen@disroot.org
10
COMMENT=	Library to work with various Half-Life file formats
10
COMMENT=	Library to work with various Half-Life file formats
11
11
12
LICENSE=	LGPL21
12
LICENSE=	LGPL21
Lines 18-25 CFLAGS+= -fpic -DUSE_ZLIB Link Here
18
18
19
PATCH_WRKSRC=	${WRKDIR}
19
PATCH_WRKSRC=	${WRKDIR}
20
20
21
HLLIB_VERS=	2.4.4
21
PLIST_FILES=	include/hl.h lib/libhl.so.${PORTVERSION} \
22
PLIST_FILES=	include/hl.h lib/libhl.so.${HLLIB_VERS} \
23
		lib/libhl.so.2 lib/libhl.so
22
		lib/libhl.so.2 lib/libhl.so
24
23
25
MAKE_ARGS=	PREFIX="${STAGEDIR}${PREFIX}"
24
MAKE_ARGS=	PREFIX="${STAGEDIR}${PREFIX}"
Lines 28-41 post-patch: Link Here
28
# Allow propagating of CXX, CXXFLAGS, and PREFIX; fix Linuxism and symlinks
27
# Allow propagating of CXX, CXXFLAGS, and PREFIX; fix Linuxism and symlinks
29
	@${REINPLACE_CMD} -E 's,^([CP][^=]*)=,\1?=, ; s,-g root,,g ; \
28
	@${REINPLACE_CMD} -E 's,^([CP][^=]*)=,\1?=, ; s,-g root,,g ; \
30
		s,-o root,,g ; s,s \$$\(PREFIX\)/lib/,s ,' ${WRKSRC}/Makefile
29
		s,-o root,,g ; s,s \$$\(PREFIX\)/lib/,s ,' ${WRKSRC}/Makefile
31
# Add forgotten file to the source list so it would be picked up by linker
30
# Fix library version
32
	@${REINPLACE_CMD} -e 's,ProcStream\.cpp,& SGAFile.cpp,' \
31
	@${REINPLACE_CMD} -e 's/2\.3\.0/2\.4\.6/' ${WRKSRC}/Makefile
33
		${WRKSRC}/Makefile
34
# Remove two lines of code that offend C++ compiler
35
	@${REINPLACE_CMD} -e '/friend CSGADirectory/d' ${WRKSRC}/SGAFile.h
36
# Add missing -lz
32
# Add missing -lz
37
	@${REINPLACE_CMD} -e '/$$(LDFLAGS)/s,$$, -lz,' ${WRKSRC}/Makefile
33
	@${REINPLACE_CMD} -e '/$$(LDFLAGS)/s,$$, -lz,' ${WRKSRC}/Makefile
38
# Fix library version
39
	@${REINPLACE_CMD} -e 's/2\.3\.0/2\.4\.4/' ${WRKSRC}/Makefile
40
34
41
.include <bsd.port.mk>
35
.include <bsd.port.mk>
(-)b/games/hllib/distinfo (-2 / +3 lines)
Lines 1-2 Link Here
1
SHA256 (hllib244.zip) = cb94da1c32e9577dce1aa2bbb77f283212684afcd7814d42228c9ffff71d3699
1
TIMESTAMP = 1622320652
2
SIZE (hllib244.zip) = 593745
2
SHA256 (hllib246.zip) = ed12bee31ec867a92e3daf4c52653ea2afb78c4ce69ca01a6f1588068ae5a1e9
3
SIZE (hllib246.zip) = 419924
(-)a/games/hllib/files/patch-HLLib-BSPFile.cpp (-19 lines)
Removed Link Here
1
--- ../orig/HLLib/BSPFile.cpp	2010-10-31 22:48:46.000000000 -0200
2
+++ ./HLLib/BSPFile.cpp	2013-02-11 17:56:51.271215107 -0200
3
@@ -203,10 +203,14 @@
4
 						hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], uiPaletteSize, hlFalse);
5
 						return hlTrue;
6
 					}
7
+					default:
8
+						;
9
 				}
10
 			}
11
 			break;
12
 		}
13
+		default:
14
+			;
15
 	}
16
 
17
 	return hlFalse;
18
Only in ./HLLib: BSPFile.cpp.orig
19
diff -ru ../orig/HLLib/DirectoryFolder.cpp ./HLLib/DirectoryFolder.cpp
(-)a/games/hllib/files/patch-HLLib-DirectoryFolder.cpp (-58 lines)
Removed Link Here
1
--- ../orig/HLLib/DirectoryFolder.cpp	2012-09-17 20:16:52.000000000 -0300
2
+++ ./HLLib/DirectoryFolder.cpp	2013-02-11 17:56:51.275211034 -0200
3
@@ -517,6 +517,8 @@
4
 		case HL_ITEM_FILE:
5
 			uiSize += static_cast<const CDirectoryFile *>(pItem)->GetSize();
6
 			break;
7
+		default:
8
+			;
9
 		}
10
 	}
11
 
12
@@ -541,6 +543,8 @@
13
 		case HL_ITEM_FILE:
14
 			uiSize += static_cast<hlULongLong>(static_cast<const CDirectoryFile *>(pItem)->GetSize());
15
 			break;
16
+		default:
17
+			;
18
 		}
19
 	}
20
 
21
@@ -565,6 +569,8 @@
22
 		case HL_ITEM_FILE:
23
 			uiSize += static_cast<const CDirectoryFile *>(pItem)->GetSizeOnDisk();
24
 			break;
25
+		default:
26
+			;
27
 		}
28
 	}
29
 
30
@@ -589,6 +595,8 @@
31
 		case HL_ITEM_FILE:
32
 			uiSize += static_cast<hlULongLong>(static_cast<const CDirectoryFile *>(pItem)->GetSizeOnDisk());
33
 			break;
34
+		default:
35
+			;
36
 		}
37
 	}
38
 
39
@@ -611,6 +619,8 @@
40
 				uiCount += static_cast<const CDirectoryFolder *>(pItem)->GetFolderCount(bRecurse);
41
 			}
42
 			break;
43
+		default:
44
+			;
45
 		}
46
 	}
47
 
48
@@ -635,6 +645,8 @@
49
 		case HL_ITEM_FILE:
50
 			uiCount++;
51
 			break;
52
+		default:
53
+			;
54
 		}
55
 	}
56
 
57
Only in ./HLLib: DirectoryFolder.cpp.orig
58
diff -ru ../orig/HLLib/Error.cpp ./HLLib/Error.cpp
(-)a/games/hllib/files/patch-HLLib-Error.cpp (-12 lines)
Removed Link Here
1
--- ../orig/HLLib/Error.cpp	2010-04-17 13:48:52.000000000 -0300
2
+++ ./HLLib/Error.cpp	2013-02-11 18:00:09.931600402 -0200
3
@@ -139,7 +139,7 @@
4
 
5
 		hlUInt uiLength = (hlUInt)strlen(this->lpSystemError);
6
 
7
-		while(uiLength >= 0 && isspace(this->lpSystemError[uiLength - 1]))
8
+		while(isspace(this->lpSystemError[uiLength - 1]))
9
 		{
10
 			uiLength--;
11
 		}
12
diff -ru ../orig/HLLib/FileStream.cpp ./HLLib/FileStream.cpp
(-)a/games/hllib/files/patch-HLLib-FileStream.cpp (-13 lines)
Removed Link Here
1
--- ../orig/HLLib/FileStream.cpp	2010-10-28 20:41:26.000000000 -0200
2
+++ ./HLLib/FileStream.cpp	2013-02-11 17:56:51.278212203 -0200
3
@@ -216,6 +216,8 @@
4
 	case HL_SEEK_END:
5
 		iMode = SEEK_END;
6
 		break;
7
+	default:
8
+		;
9
 	}
10
 
11
 	return (hlUInt)lseek(this->iFile, iOffset, iMode);
12
Only in ./HLLib: FileStream.cpp.orig
13
diff -ru ../orig/HLLib/GCFFile.cpp ./HLLib/GCFFile.cpp
(-)a/games/hllib/files/patch-HLLib-GCFFile.cpp (-27 lines)
Removed Link Here
1
--- ../orig/HLLib/GCFFile.cpp	2010-11-01 20:56:16.000000000 -0200
2
+++ ./HLLib/GCFFile.cpp	2013-02-11 17:56:51.281214140 -0200
3
@@ -789,6 +789,8 @@
4
 					}
5
 					return hlTrue;
6
 				}
7
+				default:
8
+					;
9
 			}
10
 			break;
11
 		}
12
@@ -819,9 +821,13 @@
13
 					}
14
 					return hlTrue;
15
 				}
16
+				default:
17
+					;
18
 			}
19
 			break;
20
 		}
21
+		default:
22
+			;
23
 	}
24
 
25
 	return hlFalse;
26
Only in ./HLLib: GCFFile.cpp.orig
27
diff -ru ../orig/HLLib/HLLib.cpp ./HLLib/HLLib.cpp
(-)a/games/hllib/files/patch-HLLib-HLLib.cpp (-31 lines)
Removed Link Here
1
--- ../orig/HLLib/HLLib.cpp	2010-11-01 19:45:14.000000000 -0200
2
+++ ./HLLib/HLLib.cpp	2013-02-11 17:56:51.284213443 -0200
3
@@ -153,6 +153,8 @@
4
 	case HL_PACKAGE_BOUND:
5
 		*pValue = pPackage != 0;
6
 		return hlTrue;
7
+	default:
8
+		;
9
 	}
10
 
11
 	return hlFalse;
12
@@ -171,6 +173,8 @@
13
 	case HL_FORCE_DEFRAGMENT:
14
 		bForceDefragment = bValue;
15
 		break;
16
+	default:
17
+		;
18
 	}
19
 }
20
 
21
@@ -533,6 +537,8 @@
22
 	case HL_PROC_DEFRAGMENT_PROGRESS_EX:
23
 		pDefragmentProgressExProc = (PDefragmentProgressExProc)pValue;
24
 		break;
25
+	default:
26
+		;
27
 	}
28
 }
29
 
30
Only in ./HLLib: HLLib.cpp.orig
31
diff -ru ../orig/HLLib/Makefile ./HLLib/Makefile
(-)a/games/hllib/files/patch-HLLib-NCFFile.cpp (-27 lines)
Removed Link Here
1
--- ../orig/HLLib/NCFFile.cpp	2010-10-31 22:48:26.000000000 -0200
2
+++ ./HLLib/NCFFile.cpp	2013-02-11 17:56:51.287210992 -0200
3
@@ -347,6 +347,8 @@
4
 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], this->lpDirectoryEntries[pFile->GetID()].uiDirectoryFlags, hlTrue);
5
 					return hlTrue;
6
 				}
7
+				default:
8
+					;
9
 			}
10
 			break;
11
 		}
12
@@ -360,9 +362,13 @@
13
 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], this->lpDirectoryEntries[pFolder->GetID()].uiDirectoryFlags, hlTrue);
14
 					return hlTrue;
15
 				}
16
+				default:
17
+					;
18
 			}
19
 			break;
20
 		}
21
+		default:
22
+			;
23
 	}
24
 
25
 	return hlFalse;
26
Only in ./HLLib: NCFFile.cpp.orig
27
diff -ru ../orig/HLLib/SGAFile.cpp ./HLLib/SGAFile.cpp
(-)a/games/hllib/files/patch-HLLib-SGAFile.cpp (-34 lines)
Removed Link Here
1
--- ../orig/HLLib/SGAFile.cpp	2012-11-20 20:17:10.000000000 -0200
2
+++ ./HLLib/SGAFile.cpp	2013-02-11 17:56:51.289212795 -0200
3
@@ -387,6 +387,8 @@
4
 						}
5
 						return hlFalse;
6
 					}
7
+					default:
8
+						;
9
 				}
10
 				break;
11
 			}
12
@@ -448,9 +450,13 @@
13
 						}
14
 						return hlFalse;
15
 					}
16
+					default:
17
+						;
18
 				}
19
 				break;
20
 			}
21
+			default:
22
+				;
23
 		}
24
 	}
25
 	return hlFalse;
26
@@ -624,4 +630,4 @@
27
 	{
28
 		delete []static_cast<const hlByte *>(static_cast<Streams::CMemoryStream &>(Stream).GetBuffer());
29
 	}
30
-}
31
\ No newline at end of file
32
+}
33
Only in ./HLLib: SGAFile.cpp.orig
34
diff -ru ../orig/HLLib/SGAFile.h ./HLLib/SGAFile.h
(-)a/games/hllib/files/patch-HLLib-SGAFile.h (-14 lines)
Removed Link Here
1
--- ../orig/HLLib/SGAFile.h	2012-09-17 20:16:38.000000000 -0300
2
+++ ./HLLib/SGAFile.h	2013-02-11 17:56:51.311213431 -0200
3
@@ -160,8 +160,6 @@
4
 		typedef CSGADirectory<SGADirectoryHeader4, SGASection4, SGAFolder4, SGAFile, SGAFileHeader> CSGADirectory4;
5
 		typedef CSGADirectory<SGADirectoryHeader5, SGASection5, SGAFolder5, SGAFile, SGAFileHeader> CSGADirectory5;
6
 
7
-		friend CSGADirectory4;
8
-		friend CSGADirectory5;
9
 
10
 	private:
11
 		static const char *lpAttributeNames[];
12
Only in ./HLLib: SGAFile.h.bak
13
Only in ./HLLib: SGAFile.h.orig
14
diff -ru ../orig/HLLib/VBSPFile.cpp ./HLLib/VBSPFile.cpp
(-)a/games/hllib/files/patch-HLLib-VBSPFile.cpp (-38 lines)
Removed Link Here
1
--- ../orig/HLLib/VBSPFile.cpp	2011-05-22 07:53:42.000000000 -0300
2
+++ ./HLLib/VBSPFile.cpp	2013-02-11 17:56:51.294217852 -0200
3
@@ -422,6 +422,8 @@
4
 						delete []lpComment;
5
 						return hlTrue;
6
 					}
7
+					default:
8
+						;
9
 				}
10
 			}
11
 			else
12
@@ -444,6 +446,8 @@
13
 						hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], *(hlUInt *)this->pHeader->lpLumps[uiID].lpFourCC, hlTrue);
14
 						return hlTrue;
15
 					}
16
+					default:
17
+						;
18
 				}
19
 
20
 				if(this->pEndOfCentralDirectoryRecord != 0 && pItem->GetID() == HL_VBSP_LUMP_PAKFILE)
21
@@ -466,11 +470,15 @@
22
 							delete []lpComment;
23
 							return hlTrue;
24
 						}
25
+						default:
26
+							;
27
 					}
28
 				}
29
 			}
30
 			break;
31
 		}
32
+		default:
33
+			;
34
 	}
35
 
36
 	return hlFalse;
37
Only in ./HLLib: VBSPFile.cpp.orig
38
diff -ru ../orig/HLLib/VPKFile.cpp ./HLLib/VPKFile.cpp
(-)a/games/hllib/files/patch-HLLib-VPKFile.cpp (-18 lines)
Removed Link Here
1
--- ../orig/HLLib/VPKFile.cpp	2013-01-27 14:13:28.000000000 -0200
2
+++ ./HLLib/VPKFile.cpp	2013-02-11 17:56:51.297217265 -0200
3
@@ -415,9 +415,13 @@
4
 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], pDirectoryItem->pDirectoryEntry->uiCRC, hlTrue);
5
 					return hlTrue;
6
 				}
7
+				default:
8
+					;
9
 			}
10
 			break;
11
 		}
12
+		default:
13
+			;
14
 	}
15
 
16
 	return hlFalse;
17
Only in ./HLLib: VPKFile.cpp.orig
18
diff -ru ../orig/HLLib/WADFile.cpp ./HLLib/WADFile.cpp
(-)a/games/hllib/files/patch-HLLib-WADFile.cpp (-18 lines)
Removed Link Here
1
--- ../orig/HLLib/WADFile.cpp	2010-10-31 22:56:14.000000000 -0200
2
+++ ./HLLib/WADFile.cpp	2013-02-11 17:56:51.300216459 -0200
3
@@ -200,9 +200,13 @@
4
 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], (hlUInt)pLump->iType, hlTrue);
5
 					return hlTrue;
6
 				}
7
+				default:
8
+					;
9
 			}
10
 			break;
11
 		}
12
+		default:
13
+			;
14
 	}
15
 
16
 	return hlFalse;
17
Only in ./HLLib: WADFile.cpp.orig
18
diff -ru ../orig/HLLib/XZPFile.cpp ./HLLib/XZPFile.cpp
(-)a/games/hllib/files/patch-HLLib-XZPFile.cpp (-27 lines)
Removed Link Here
1
--- ../orig/HLLib/XZPFile.cpp	2010-10-31 22:49:18.000000000 -0200
2
+++ ./HLLib/XZPFile.cpp	2013-02-11 17:56:51.302217604 -0200
3
@@ -197,7 +197,7 @@
4
 		for(hlUInt i = 0; i < this->pHeader->uiDirectoryEntryCount; i++)
5
 		{
6
 			hlChar lpTemp[16] = "";
7
-			hlChar *lpLookup[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
8
+			const hlChar *lpLookup[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
9
 			for(hlByte *lpCRC = (hlByte *)&this->lpDirectoryEntries[i].uiFileNameCRC; lpCRC < (hlByte *)&this->lpDirectoryEntries[i].uiFileNameCRC + sizeof(hlUInt); lpCRC++)
10
 			{
11
 				strcat(lpTemp, lpLookup[(hlByte)(*lpCRC >> 4)]);
12
@@ -299,9 +299,13 @@
13
 					hlAttributeSetUnsignedInteger(&Attribute, this->lpItemAttributeNames[eAttribute], uiSize, hlFalse);
14
 					return hlTrue;
15
 				}
16
+				default:
17
+					;
18
 			}
19
 			break;
20
 		}
21
+		default:
22
+			;
23
 	}
24
 
25
 	return hlFalse;
26
Only in ./HLLib: XZPFile.cpp.orig
27
diff -ru ../orig/HLLib/ZIPFile.cpp ./HLLib/ZIPFile.cpp
(-)a/games/hllib/files/patch-HLLib-ZIPFile.cpp (-24 lines)
Removed Link Here
1
--- ../orig/HLLib/ZIPFile.cpp	2012-09-18 19:51:30.000000000 -0300
2
+++ ./HLLib/ZIPFile.cpp	2013-02-11 17:56:51.305211203 -0200
3
@@ -393,9 +393,13 @@
4
 					delete []lpComment;
5
 					return hlTrue;
6
 				}
7
+				default:
8
+					;
9
 			}
10
 			break;
11
 		}
12
+		default:
13
+			;
14
 	}
15
 
16
 	return hlFalse;
17
@@ -598,4 +602,4 @@
18
 	{
19
 		delete []static_cast<const hlByte *>(static_cast<Streams::CMemoryStream &>(Stream).GetBuffer());
20
 	}
21
-}
22
\ No newline at end of file
23
+}
24
Only in ./HLLib: ZIPFile.cpp.orig
(-)b/games/hllib/files/patch-HLLib_SGAFile.cpp (+123 lines)
Added Link Here
1
--- HLLib/SGAFile.cpp.orig	2021-05-29 21:01:07 UTC
2
+++ HLLib/SGAFile.cpp
3
@@ -301,37 +301,37 @@ CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeade
4
 template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
5
 hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::MapDataStructures()
6
 {
7
-	if(!this->File.pMapping->Map(this->pHeaderDirectoryView, sizeof(SGAHeader), static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength))
8
+	if(!this->File.pMapping->Map(this->pHeaderDirectoryView, sizeof(TSGAHeader), static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength))
9
 	{
10
 		return hlFalse;
11
 	}
12
 
13
-	this->pDirectoryHeader = static_cast<const SGADirectoryHeader *>(this->pHeaderDirectoryView->GetView());
14
+	this->pDirectoryHeader = static_cast<const TSGADirectoryHeader *>(this->pHeaderDirectoryView->GetView());
15
 
16
-	if(this->pDirectoryHeader->uiSectionCount > 0 && this->pDirectoryHeader->uiSectionOffset + sizeof(SGASection) * this->pDirectoryHeader->uiSectionCount > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
17
+	if(this->pDirectoryHeader->uiSectionCount > 0 && this->pDirectoryHeader->uiSectionOffset + sizeof(TSGASection) * this->pDirectoryHeader->uiSectionCount > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
18
 	{
19
 		LastError.SetErrorMessage("Invalid file: the file map is too small for section data.");
20
 		return hlFalse;
21
 	}
22
-	if(this->pDirectoryHeader->uiFolderCount > 0 && this->pDirectoryHeader->uiFolderOffset + sizeof(SGAFolder) * this->pDirectoryHeader->uiFolderCount > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
23
+	if(this->pDirectoryHeader->uiFolderCount > 0 && this->pDirectoryHeader->uiFolderOffset + sizeof(TSGAFolder) * this->pDirectoryHeader->uiFolderCount > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
24
 	{
25
 		LastError.SetErrorMessage("Invalid file: the file map is too small for folder data.");
26
 		return hlFalse;
27
 	}
28
-	if(this->pDirectoryHeader->uiFileCount > 0 && this->pDirectoryHeader->uiFileOffset + sizeof(SGAFile) * this->pDirectoryHeader->uiFileCount > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
29
+	if(this->pDirectoryHeader->uiFileCount > 0 && this->pDirectoryHeader->uiFileOffset + sizeof(TSGAFile) * this->pDirectoryHeader->uiFileCount > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
30
 	{
31
 		LastError.SetErrorMessage("Invalid file: the file map is too small for file data.");
32
 		return hlFalse;
33
 	}
34
-	if(this->pDirectoryHeader->uiStringTableOffset > static_cast<const SGAHeader *>(this->File.pHeader)->uiHeaderLength)
35
+	if(this->pDirectoryHeader->uiStringTableOffset > static_cast<const TSGAHeader *>(this->File.pHeader)->uiHeaderLength)
36
 	{
37
 		LastError.SetErrorMessage("Invalid file: the file map is too small for string table data.");
38
 		return hlFalse;
39
 	}
40
 
41
-	this->lpSections = reinterpret_cast<const SGASection *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiSectionOffset);
42
-	this->lpFolders = reinterpret_cast<const SGAFolder *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFolderOffset);
43
-	this->lpFiles = reinterpret_cast<const SGAFile *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFileOffset);
44
+	this->lpSections = reinterpret_cast<const TSGASection *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiSectionOffset);
45
+	this->lpFolders = reinterpret_cast<const TSGAFolder *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFolderOffset);
46
+	this->lpFiles = reinterpret_cast<const TSGAFile *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiFileOffset);
47
 	this->lpStringTable = reinterpret_cast<const hlChar *>(reinterpret_cast<const hlByte *>(this->pDirectoryHeader) + this->pDirectoryHeader->uiStringTableOffset);
48
 
49
 	return hlTrue;
50
@@ -352,7 +352,7 @@ hlVoid CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
51
 template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
52
 CDirectoryFolder *CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::CreateRoot()
53
 {
54
-	CDirectoryFolder *pRoot = new CDirectoryFolder(&File);
55
+	CDirectoryFolder *pRoot = new CDirectoryFolder(&this->File);
56
 
57
 	for(hlUInt i = 0; i < this->pDirectoryHeader->uiSectionCount; i++)
58
 	{
59
@@ -558,7 +558,7 @@ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
60
 			case HL_ITEM_FILE:
61
 			{
62
 				const CDirectoryFile *pFile = static_cast<const CDirectoryFile *>(pItem);
63
-				const SGAFile &File = this->lpFiles[pFile->GetID()];
64
+				const TSGAFile &File = this->lpFiles[pFile->GetID()];
65
 				switch(eAttribute)
66
 				{
67
 					case HL_SGA_ITEM_SECTION_ALIAS:
68
@@ -613,7 +613,7 @@ template<typename TSGAHeader, typename TSGADirectoryHe
69
 hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::GetFileExtractableInternal(const CDirectoryFile *pFile, hlBool &bExtractable) const
70
 {
71
 #if !USE_ZLIB
72
-	const SGAFile &File = this->lpFiles[pFile->GetID()];
73
+	const TSGAFile &File = this->lpFiles[pFile->GetID()];
74
 
75
 	bExtractable = File.uiType == 0;
76
 #else
77
@@ -831,7 +831,7 @@ hlBool CSGAFile::CSGASpecializedDirectory<TSGAHeader, 
78
 template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
79
 hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::GetFileSizeInternal(const CDirectoryFile *pFile, hlUInt &uiSize) const
80
 {
81
-	const SGAFile &File = this->lpFiles[pFile->GetID()];
82
+	const TSGAFile &File = this->lpFiles[pFile->GetID()];
83
 
84
 	uiSize = File.uiSize;
85
 
86
@@ -841,7 +841,7 @@ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
87
 template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
88
 hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::GetFileSizeOnDiskInternal(const CDirectoryFile *pFile, hlUInt &uiSize) const
89
 {
90
-	const SGAFile &File = this->lpFiles[pFile->GetID()];
91
+	const TSGAFile &File = this->lpFiles[pFile->GetID()];
92
 
93
 	uiSize = File.uiSizeOnDisk;
94
 
95
@@ -851,18 +851,18 @@ hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
96
 template<typename TSGAHeader, typename TSGADirectoryHeader, typename TSGASection, typename TSGAFolder, typename TSGAFile>
97
 hlBool CSGAFile::CSGADirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, TSGAFile>::CreateStreamInternal(const CDirectoryFile *pFile, Streams::IStream *&pStream) const
98
 {
99
-	const SGAFile &File = this->lpFiles[pFile->GetID()];
100
+	const TSGAFile &File = this->lpFiles[pFile->GetID()];
101
 
102
 	if(File.uiType == 0)
103
 	{
104
-		pStream = new Streams::CMappingStream(*this->File.pMapping, static_cast<const SGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk);
105
+		pStream = new Streams::CMappingStream(*this->File.pMapping, static_cast<const TSGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk);
106
 		return hlTrue;
107
 	}
108
 	else
109
 	{
110
 #if USE_ZLIB
111
 		Mapping::CView *pFileDataView = 0;
112
-		if(this->File.pMapping->Map(pFileDataView, static_cast<const SGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk))
113
+		if(this->File.pMapping->Map(pFileDataView, static_cast<const TSGAHeader *>(this->File.pHeader)->uiFileDataOffset + File.uiOffset, File.uiSizeOnDisk))
114
 		{
115
 			hlBool bResult = hlFalse;
116
 			hlByte *lpInflateBuffer = new hlByte[File.uiSize];
117
@@ -905,4 +905,4 @@ hlVoid CSGAFile::CSGADirectory<TSGAHeader, TSGADirecto
118
 	{
119
 		delete []static_cast<const hlByte *>(static_cast<Streams::CMemoryStream &>(Stream).GetBuffer());
120
 	}
121
-}
122
\ No newline at end of file
123
+}
(-)b/games/hllib/files/patch-HLLib_SGAFile.h (+60 lines)
Added Link Here
1
--- HLLib/SGAFile.h.orig	2021-05-29 20:58:37 UTC
2
+++ HLLib/SGAFile.h
3
@@ -163,11 +163,11 @@ namespace HLLib
4
 		class CSGASpecializedDirectory : public ISGADirectory
5
 		{
6
 		public:
7
-			typedef typename TSGAHeader SGAHeader;
8
-			typedef typename TSGADirectoryHeader SGADirectoryHeader;
9
-			typedef typename TSGASection SGASection;
10
-			typedef typename TSGAFolder SGAFolder;
11
-			typedef typename TSGAFile SGAFile;
12
+			typedef TSGAHeader SGAHeader;
13
+			typedef TSGADirectoryHeader SGADirectoryHeader;
14
+			typedef TSGASection SGASection;
15
+			typedef TSGAFolder SGAFolder;
16
+			typedef TSGAFile SGAFile;
17
 
18
 			CSGASpecializedDirectory(CSGAFile& File);
19
 
20
@@ -192,10 +192,10 @@ namespace HLLib
21
 		class CSGASpecializedDirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, SGAFile4> : public ISGADirectory
22
 		{
23
 		public:
24
-			typedef typename TSGAHeader SGAHeader;
25
-			typedef typename TSGADirectoryHeader SGADirectoryHeader;
26
-			typedef typename TSGASection SGASection;
27
-			typedef typename TSGAFolder SGAFolder;
28
+			typedef TSGAHeader SGAHeader;
29
+			typedef TSGADirectoryHeader SGADirectoryHeader;
30
+			typedef TSGASection SGASection;
31
+			typedef TSGAFolder SGAFolder;
32
 			typedef CSGAFile::SGAFile4 SGAFile;
33
 
34
 			CSGASpecializedDirectory(CSGAFile& File);
35
@@ -221,10 +221,10 @@ namespace HLLib
36
 		class CSGASpecializedDirectory<TSGAHeader, TSGADirectoryHeader, TSGASection, TSGAFolder, SGAFile6> : public ISGADirectory
37
 		{
38
 		public:
39
-			typedef typename TSGAHeader SGAHeader;
40
-			typedef typename TSGADirectoryHeader SGADirectoryHeader;
41
-			typedef typename TSGASection SGASection;
42
-			typedef typename TSGAFolder SGAFolder;
43
+			typedef TSGAHeader SGAHeader;
44
+			typedef TSGADirectoryHeader SGADirectoryHeader;
45
+			typedef TSGASection SGASection;
46
+			typedef TSGAFolder SGAFolder;
47
 			typedef CSGAFile::SGAFile6 SGAFile;
48
 
49
 			CSGASpecializedDirectory(CSGAFile& File);
50
@@ -276,10 +276,6 @@ namespace HLLib
51
 		typedef CSGADirectory<SGAHeader6, SGADirectoryHeader5, SGASection5, SGAFolder5, SGAFile6> CSGADirectory6;
52
 		typedef CSGADirectory<SGAHeader6, SGADirectoryHeader7, SGASection5, SGAFolder5, SGAFile7> CSGADirectory7;
53
 
54
-		friend CSGADirectory4;
55
-		friend CSGADirectory5;
56
-		friend CSGADirectory6;
57
-		friend CSGADirectory7;
58
 
59
 	private:
60
 		static const char *lpAttributeNames[];
(-)b/games/hllib/pkg-descr (-1 / +1 lines)
Lines 6-9 standard C imports). HLLib works natively in both Windows and *nix. BSP, Link Here
6
GCF, NCF, PAK, SGA, VPK, WAD, XZP, and ZIP (store/deflate) package formats
6
GCF, NCF, PAK, SGA, VPK, WAD, XZP, and ZIP (store/deflate) package formats
7
are supported.
7
are supported.
8
8
9
WWW: http://nemesis.thewavelength.net/index.php?p=35
9
WWW: https://developer.valvesoftware.com/wiki/HLLib

Return to bug 256249