Skip to content

Commit

Permalink
maybe libclang will fix it?
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Jul 1, 2024
1 parent 82af274 commit 9a100fe
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 22 deletions.
28 changes: 14 additions & 14 deletions c/p0001.c
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/*
Project Euler Problem 1
I know that this could be done faster with a traditional for loop, but I wanted
to see if iterators were reasonably possible in C, since it makes the prime
number infrastructure a lot easier to set up.
Problem:
If we list all the natural numbers below 10 that are multiples of 3 or 5, we
get 3, 5, 6 and 9. The sum of these multiples is 23.
Find the sum of all the multiples of 3 or 5 below 1000.
*/
/**
* Project Euler Problem 1
*
* I know that this could be done faster with a traditional for loop, but I wanted
* to see if iterators were reasonably possible in C, since it makes the prime
* number infrastructure a lot easier to set up.
*
* Problem:
*
* If we list all the natural numbers below 10 that are multiples of 3 or 5, we
* get 3, 5, 6 and 9. The sum of these multiples is 23.
*
* Find the sum of all the multiples of 3 or 5 below 1000.
*/
#ifndef EULER_P0001
#define EULER_P0001
#include <stdio.h>
Expand Down
8 changes: 5 additions & 3 deletions docs/c/p0001.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ C Implementation of Problem 1

View source code `here on GitHub! <https://github.com/LivInTheLookingGlass/Euler/blob/master/c/p0001.c>`_

.. autocmodule:: p0001.c
:members:
:undoc-members:
.. c:autosection:: Project Euler Problem 1
:file: p0001.c

.. c:autodoc:: p0001.c
:clang: -std=c11 -DAMD_COMPILER=0
7 changes: 4 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, basedir)
sys.path.insert(0, basedir + os.sep + 'python')
c_autodoc_roots = [basedir + os.sep + 'c']
c_autodoc_compilation_args = ['-std=c11', '-DAMD_COMPILER=0']
hawkmoth_root = basedir + os.sep + 'c'
hackmouth_clang = ['-std=c11', '-DAMD_COMPILER=0']
hawmouth_source_uri = 'https://github.com/LivInTheLookingGlass/Euler/blob/master/{source}#L{line}'
js_source_path = basedir + os.sep + 'javascript'

project = 'Euler'
Expand All @@ -30,7 +31,7 @@
'sphinx.ext.inheritance_diagram',
'sphinx.ext.mathjax',
'sphinx.ext.todo',
'sphinx_c_autodoc',
'hawkmoth',
# 'breathe',
# 'javasphinx',
# 'sphinx_autodoc_typehints',
Expand Down
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
sphinx>=3.1
sphinx-rtd-theme
sphinx-js
sphinx-c-autodoc
beautifulsoup4
hawkmoth

0 comments on commit 9a100fe

Please sign in to comment.