Skip to content

Fix issues newly flagged by Doxygen 1.11.0 #925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,33 +154,41 @@ jobs:
if: github.ref_type == 'tag' && matrix.check_mkvk != 'ONLY'
run: git fetch -f origin ${{ github.ref }}:${{ github.ref }}

# Need doxygen if docs are supposed to be built.
# Note this suffers frequent failures due to Chocolatey attempts
# Need doxygen and graphviz if docs are supposed to be built.
# Note these suffer frequent failures due to Chocolatey attempts
# to blackmail you into purchasing a license. Hence we retry a
# few times. If this still fails, re-run the build.
- name: Install Doxygen
- name: Install Doxygen and Graphviz
if: matrix.options.doc == 'ON'
#run: choco install doxygen.install
#run: choco install graphviz
run: |
$retryCount = 4
$success = $false
for ($i = 1; $i -le $retryCount; $i++) {
Write-Host "Attempt no: $i"
choco install doxygen.install --no-progress
if ($LASTEXITCODE -eq 0) {
$success = $true
Write-Host "Installation successful."
break
} else {
Write-Host "Installation failed. Retrying..."
Start-Sleep -Seconds (2*$i)
function Install-WithChoco {
param ( $Package )
$retryCount = 4
$success = $false
for ($i = 1; $i -le $retryCount; $i++) {
Write-Host "Attempt no $i for $Package"
# Without | Out-Host the choco output becomes output of this
# function because it is called from within `if`.
choco install $Package --no-progress --yes | Out-Host
if ($LASTEXITCODE -eq 0) {
$success = $true
Write-Host "$Package installation successful."
break
} else {
Write-Host "$Package installation failed. Retrying..."
Start-Sleep -Seconds (2*$i)
}
}
if (-not $success) {
Write-Host "$Package installation failed after $retryCount attempts."
}
return $success
}
if (-not $success) {
Write-Host "Installation failed after $retryCount attempts."
if (-not ((Install-WithChoco doxygen.install) -and (Install-WithChoco graphviz))) {
exit 1
}

- name: Install AzureSignTool
if: matrix.check_mkvk != 'ONLY'
id: install-ast
Expand Down
7 changes: 6 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ addons:
update: false
packages:
- git-lfs
- doxygen

env:
global:
Expand Down Expand Up @@ -107,6 +106,7 @@ jobs:
addons:
apt:
packages:
- graphviz
- python3
- python3-venv
compiler: gcc
Expand All @@ -127,6 +127,7 @@ jobs:
addons:
apt:
packages:
- graphviz
- python3
- python3-venv
compiler: gcc
Expand Down Expand Up @@ -246,6 +247,10 @@ install:
brew install sdl2
brew install assimp
fi
if [ "$FEATURE_DOC" = "ON" ]; then
brew install doxygen
brew install graphviz
fi
./scripts/install_macos.sh
fi
;;
Expand Down
18 changes: 14 additions & 4 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,13 +570,23 @@ For iOS and macOS, install the Vulkan SDK by downloading the macOS installer and

### Doxygen

Needed if you want to generate the _libktx_ and _ktxtools_ documentation.
Needed if you want to generate _libktx_, _ktxtools_ and other documentation.

You need a minimum of version 1.8.14 to generate the documentation correctly. You
can download binaries and also find instructions for building it from source at
[Doxygen downloads](http://www.stack.nl/~dimitri/doxygen/download.html). Make
You need a minimum of version 1.8.14 to generate the documentation correctly.
You can download binaries and also find instructions for building it from source
at [Doxygen downloads](http://www.stack.nl/~dimitri/doxygen/download.html). Make
sure the directory containing the `doxygen` executable is in your `$PATH`.

### dot (Graphviz)

Needed if you want Doxygen to generate include dependency, inverse include
dependency, inheritance and other graphs in the generated documentation.

You can download binaries from
[Graphviz downloads](https://graphviz.org/download/).

Optional. If not present documentation will be generated minus graphs.

### libassimp

Needed if you want to build the KTX load tests.
Expand Down
11 changes: 10 additions & 1 deletion cmake/docs.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
# Copyright 2015-2020 The Khronos Group Inc.
# SPDX-License-Identifier: Apache-2.0

find_package(Doxygen REQUIRED)
# dot is optional as missing include dependency graphs and
# inheritance graphs is not a big enough deal to justify
# forcing people to install Graphviz.
find_package(Doxygen REQUIRED OPTIONAL_COMPONENTS dot)
if(NOT DOXYGEN_DOT_EXECUTABLE)
message(NOTICE "dot executable not found so Doxygen will not generate\n"
"include dependency or inheritance graphs in the documentation.\n"
"If you want these graphs, install Graphviz.")
endif()

set(docdest "${CMAKE_CURRENT_BINARY_DIR}/docs")

Expand Down Expand Up @@ -85,6 +93,7 @@ function( CreateDocLibKTX )
set( DOXYGEN_EXPAND_ONLY_PREDEF YES )

set( DOXYGEN_PREDEFINED
KTX_DOXYGEN_SKIP
"KTXTEXTURECLASSDEFN=class_id classId\; \\
struct ktxTexture_vtbl* vtbl\; \\
struct ktxTexture_vvtbl* vvtbl\; \\
Expand Down
8 changes: 4 additions & 4 deletions include/KHR/khr_df.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
#ifndef _KHR_DATA_FORMAT_H_
#define _KHR_DATA_FORMAT_H_

/** @file khr_df.h

@brief Data Format enums and macros.
*/
/** @file
* @~English
* @brief Data Format enums and macros.
*/

/* Accessors */
typedef enum _khr_word_e {
Expand Down
46 changes: 29 additions & 17 deletions include/ktx.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ typedef enum ktx_error_code_e {
KTX_ERROR_MAX_ENUM = KTX_DECOMPRESS_CHECKSUM_ERROR /*!< For safety checks. */
} ktx_error_code_e;
/**
* @deprecated
* @~English
* @deprecated Use #ktx_error_code_e.
* @brief For backward compatibility
*/
#define KTX_error_code ktx_error_code_e
Expand Down Expand Up @@ -719,12 +719,24 @@ typedef struct ktxTexture2 {
struct ktxTexture2_private* _private; /*!< Private data. */
} ktxTexture2;

/**
* @brief Helper for casting ktxTexture1 and ktxTexture2 to ktxTexture.
/*
* If Doxygen sees this macro it gets confused and fails to spot
* references to ktxTexture_*() functions in the running text. It
* also complains it can't find the reference when @ref is used
* with a fully qualified method name to make an intra-class
* reference in the @c ktxTexture class.
* See https://github.com/doxygen/doxygen/issues/10311.
*
* Use with caution.
*/
#define ktxTexture(t) ((ktxTexture*)t)
* Not documenting the macro is the lesser of two evils.
*/
#if !defined(KTX_DOXYGEN_SKIP)
/**
* @brief Helper for casting ktxTexture1 and ktxTexture2 to ktxTexture.
*
* Use with caution.
*/
#define ktxTexture(t) ((ktxTexture*)t)
#endif

/**
* @memberof ktxTexture
Expand Down Expand Up @@ -1391,7 +1403,7 @@ typedef struct ktxBasisParams {
Only valid for linear textures.
*/
ktx_bool_t separateRGToRGB_A;
/*!< @deprecated. This was and is a no-op. 2-component inputs have
/*!< @deprecated This was and is a no-op. 2-component inputs have
always been automatically separated using an "rrrg" inputSwizzle.
@sa inputSwizzle and normalMode.
*/
Expand Down Expand Up @@ -1586,25 +1598,25 @@ typedef enum ktx_transcode_fmt_e {
// Old enums for compatibility with code compiled against previous
// versions of libktx.
KTX_TF_ETC1 = KTX_TTF_ETC1_RGB,
//!< @deprecated. Use #KTX_TTF_ETC1_RGB.
//!< @deprecated Use #KTX_TTF_ETC1_RGB.
KTX_TF_ETC2 = KTX_TTF_ETC,
//!< @deprecated. Use #KTX_TTF_ETC.
//!< @deprecated Use #KTX_TTF_ETC.
KTX_TF_BC1 = KTX_TTF_BC1_RGB,
//!< @deprecated. Use #KTX_TTF_BC1_RGB.
//!< @deprecated Use #KTX_TTF_BC1_RGB.
KTX_TF_BC3 = KTX_TTF_BC3_RGBA,
//!< @deprecated. Use #KTX_TTF_BC3_RGBA.
//!< @deprecated Use #KTX_TTF_BC3_RGBA.
KTX_TF_BC4 = KTX_TTF_BC4_R,
//!< @deprecated. Use #KTX_TTF_BC4_R.
//!< @deprecated Use #KTX_TTF_BC4_R.
KTX_TF_BC5 = KTX_TTF_BC5_RG,
//!< @deprecated. Use #KTX_TTF_BC5_RG.
//!< @deprecated Use #KTX_TTF_BC5_RG.
KTX_TTF_BC7_M6_RGB = KTX_TTF_BC7_RGBA,
//!< @deprecated. Use #KTX_TTF_BC7_RGBA.
//!< @deprecated Use #KTX_TTF_BC7_RGBA.
KTX_TTF_BC7_M5_RGBA = KTX_TTF_BC7_RGBA,
//!< @deprecated. Use #KTX_TTF_BC7_RGBA.
//!< @deprecated Use #KTX_TTF_BC7_RGBA.
KTX_TF_BC7_M6_OPAQUE_ONLY = KTX_TTF_BC7_RGBA,
//!< @deprecated. Use #KTX_TTF_BC7_RGBA
//!< @deprecated Use #KTX_TTF_BC7_RGBA
KTX_TF_PVRTC1_4_OPAQUE_ONLY = KTX_TTF_PVRTC1_4_RGB
//!< @deprecated. Use #KTX_TTF_PVRTC1_4_RGB.
//!< @deprecated Use #KTX_TTF_PVRTC1_4_RGB.
} ktx_transcode_fmt_e;

/**
Expand Down
10 changes: 5 additions & 5 deletions lib/astc_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file astc_encode.cpp
* @file
* @~English
*
* @brief Functions for compressing a texture to ASTC format.
Expand Down Expand Up @@ -201,7 +201,7 @@ unorm8x4ArrayToImage(const uint8_t *data, uint32_t dim_x, uint32_t dim_y) {

/**
* @memberof ktxTexture
* @ingroup write
* @ingroup writer
* @~English
* @brief Creates default ASTC parameters
*
Expand All @@ -222,7 +222,7 @@ astcDefaultOptions() {

/**
* @memberof ktxTexture
* @ingroup write
* @ingroup writer
* @~English
* @brief Should be used to get VkFormat from ASTC block enum
*
Expand Down Expand Up @@ -291,7 +291,7 @@ astcVkFormat(ktx_uint32_t block_size, bool sRGB) {

/**
* @memberof ktxTexture
* @ingroup write
* @ingroup writer
* @~English
* @brief Creates valid ASTC encoder action from string.
*
Expand Down Expand Up @@ -320,7 +320,7 @@ astcEncoderAction(const ktxAstcParams &params, const uint32_t* bdb) {

/**
* @memberof ktxTexture
* @ingroup write
* @ingroup writer
* @~English
* @brief Creates valid ASTC encoder swizzle from string.
*
Expand Down
2 changes: 1 addition & 1 deletion lib/basis_encode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file basis_encode.cpp
* @file
* @~English
*
* @brief Functions for supercompressing a texture with Basis Universal.
Expand Down
2 changes: 1 addition & 1 deletion lib/basis_transcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file basis_transcode.cpp
* @file
* @~English
*
* @brief Functions for transcoding Basis Universal BasisLZ/ETC1S and UASTC textures.
Expand Down
2 changes: 1 addition & 1 deletion lib/checkheader.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* @internal
* @file checkheader.c
* @file
* @~English
*
* @brief Function to verify a KTX file header
Expand Down
2 changes: 1 addition & 1 deletion lib/gl_funclist.inl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file gl_funclist.h
* @file
* @~English
*
* @brief List of OpenGL {,ES} functions used by libktx.
Expand Down
2 changes: 1 addition & 1 deletion lib/gl_funcs.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file gl_funcs.c
* @file
* @~English
*
* @brief Retrieve OpenGL function pointers needed by libktx
Expand Down
2 changes: 1 addition & 1 deletion lib/gl_funcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file vk_funcs.h
* @file
* @~English
*
* @brief Declare pointers for OpenGL {,ES} functions.
Expand Down
2 changes: 1 addition & 1 deletion lib/hashlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file hashlist.c
* @file
* @~English
*
* @brief Functions for creating and using a hash list of key-value
Expand Down
2 changes: 1 addition & 1 deletion lib/info.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

/**
* @internal
* @file info.c
* @file
* @~English
*
* @brief Functions for printing information about KTX or KTX2.
Expand Down
2 changes: 1 addition & 1 deletion lib/miniz_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

/**
* @internal
* @file miniz_wrapper.c
* @file
* @~English
*
* @brief Wrapper functions for ZLIB compression/decompression using miniz.
Expand Down
2 changes: 1 addition & 1 deletion lib/strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

/**
* @file strings.c
* @file
* @~English
*
* @brief Functions to return a string corresponding to various enumerations.
Expand Down
2 changes: 1 addition & 1 deletion lib/texture.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

/**
* @internal
* @file texture.c
* @file
* @~English
*
* @brief ktxTexture implementation.
Expand Down
Loading