Skip to content

Commit 89839f6

Browse files
committed
Update Sphinx documentation
These changes allow the documentation to be hosted on readthedocs.io. Also, update a code sample to avoid a nullptr access
1 parent 9455320 commit 89839f6

File tree

3 files changed

+19
-14
lines changed

3 files changed

+19
-14
lines changed

docs/source/_static/theme_overrides.css

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
/* This override allows text in table cells to wrap.
2-
Without this override, the descritpions in the
3-
command line options tables are very long and
4-
the table is displayed with a horizontal scroll
5-
bar */
1+
/* This override allows text in table cells to wrap.*/
2+
63
@media screen and (min-width: 767px) {
74

85
.wy-table-responsive table td {
@@ -17,5 +14,5 @@
1714
}
1815

1916
table.docutils div.line-block {
20-
margin-left: 0;
17+
margin-left: 0 !important;
2118
}

docs/source/conf.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,12 @@
115115
# so a file named "default.css" will overwrite the builtin "default.css".
116116
html_static_path = ['_static']
117117

118-
html_context = {
119-
'css_files': [
120-
'_static/theme_overrides.css', # override wide tables in RTD theme
121-
],
122-
}
118+
# If a function setup(app) exists, Sphinx will call this function as a normal
119+
# extension during application startup. This method of using the overrides css
120+
# file works better with read the docs (more so than specifying it via the
121+
# html_context tag)
122+
def setup(app):
123+
app.add_stylesheet('theme_overrides.css')
123124

124125
# Custom sidebar templates, must be a dictionary that maps document names
125126
# to template names.

docs/source/usage.rst

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,23 @@ initialize the DirectX 12 version of GPA:
6969

7070
GPAApiManager* GPAApiManager::m_pGpaApiManager = nullptr;
7171

72-
GPAFunctionTable* pGpaFunctionTable;
72+
GPAFunctionTable* pGpaFunctionTable = nullptr;
7373

7474
bool InitializeGPA()
7575
{
76+
bool retVal = false;
77+
7678
if (GPA_STATUS_OK == GPAApiManager::Instance()->LoadApi(GPA_API_DIRECTX_12))
7779
{
7880
pGpaFunctionTable = GPAApiManager::Instance()->GetFunctionTable(GPA_API_DIRECTX_12);
81+
82+
if (nullptr != pGpaFunctionTable)
83+
{
84+
retVal = GPA_STATUS_OK == pGpaFunctionTable->GPA_Initialize(GPA_INITIALIZE_DEFAULT_BIT);
85+
}
7986
}
8087

81-
return GPA_STATUS_OK == pGpaFunctionTable->GPA_Initialize(GPA_INITIALIZE_DEFAULT_BIT);
88+
return retVal;
8289
}
8390

8491
Registering a Logging Callback
@@ -170,7 +177,7 @@ required type which should be passed to GPA_OpenContext:
170177
Querying a Context and Counters
171178
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
172179

173-
After creating a Context, you can use the returned GPA_ContextId to query
180+
After creating a context, you can use the returned GPA_ContextId to query
174181
information about the context and the performance counters exposed by the
175182
context.
176183

0 commit comments

Comments
 (0)