Re: [zathura] [PATCH 1/1] update API for mupdf 1.9

2016-05-17 Thread Sebastian Ramacher
On 2016-05-13 12:50:18, Leonardo Taccari wrote:
> Hello Sebastian,
> 
> Sebastian Ramacher writes:
> > [...] 
> > Could you send an updated patch against zathura-pdf-mupdf's develop branch?
> > Ideally something easily git am-able.
> Sure! I'll attach the patch in this mail (please let me know if I missed
> something or if the format isn't good).

Thank you, applied.

Cheers
-- 
Sebastian Ramacher
___
zathura mailing list
zathura@lists.pwmt.org
https://lists.pwmt.org/mailman/listinfo/zathura


Re: [zathura] [PATCH 1/1] update API for mupdf 1.9

2016-05-13 Thread Leonardo Taccari
Hello Sebastian,

Sebastian Ramacher writes:
> [...] 
> Could you send an updated patch against zathura-pdf-mupdf's develop branch?
> Ideally something easily git am-able.
Sure! I'll attach the patch in this mail (please let me know if I missed
something or if the format isn't good).


Thank you very much!
Ciao,
L.
From 4e6aa88e7968e948bcbc2d5eed48dabf37d12d93 Mon Sep 17 00:00:00 2001
From: Leonardo Taccari 
Date: Fri, 13 May 2016 12:41:23 +0200
Subject: [PATCH] document.c: pass NULL as the 4th argument to
 pdf_save_document()

Passing a `{ 0 }' as 4th argument to pdf_save_document() is no longer needed.
Just pass NULL and get rid of opts.

At least in recent mupdf (version 1.9a) `*in_opts' (the 4th argument of
pdf_save_document()) is checked if NULL and in that case the default options are
used.
---
 document.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/document.c b/document.c
index 548f4ff..8d0aae4 100644
--- a/document.c
+++ b/document.c
@@ -109,12 +109,7 @@ pdf_document_save_as(zathura_document_t* document, mupdf_document_t*
   }
 
   fz_try (mupdf_document->ctx) {
-/* pdf_save_document claims to accepts NULL as third argument but doesn't.
- * pdf_write_document does not check if the third arguments is NULL for some
- * options. */
-
-pdf_write_options opts = { 0 }; /* just use the default options */
-pdf_save_document(mupdf_document->ctx, (pdf_document*) mupdf_document->document, (char*) path, &opts);
+pdf_save_document(mupdf_document->ctx, (pdf_document*) mupdf_document->document, (char*) path, NULL);
   } fz_catch (mupdf_document->ctx) {
 return ZATHURA_ERROR_UNKNOWN;
   }
-- 
2.8.2

___
zathura mailing list
zathura@lists.pwmt.org
https://lists.pwmt.org/mailman/listinfo/zathura


Re: [zathura] [PATCH 1/1] update API for mupdf 1.9

2016-05-13 Thread Sebastian Ramacher
Hello Leonardo

On 2016-05-13 11:37:21, Leonardo Taccari wrote:
> Hello Christian!
> 
> Christian Hesse writes:
> > [...]
> > --- a/document.c
> > +++ b/document.c
> > @@ -109,12 +109,12 @@ pdf_document_save_as(zathura_document_t* document, 
> > mupdf_document_t*
> >}
> >  
> >fz_try (mupdf_document->ctx) {
> > -/* fz_write_document claims to accepts NULL as third argument but 
> > doesn't.
> > +/* pdf_save_document claims to accepts NULL as third argument but 
> > doesn't.
> >   * pdf_write_document does not check if the third arguments is NULL 
> > for some
> >   * options. */
> >  
> > -fz_write_options opts = { 0 }; /* just use the default options */
> > -fz_write_document(mupdf_document->ctx, mupdf_document->document, 
> > (char*) path, &opts);
> > +pdf_write_options opts = { 0 }; /* just use the default options */
> > +pdf_save_document(mupdf_document->ctx, (pdf_document*) 
> > mupdf_document->document, (char*) path, &opts);
> >} fz_catch (mupdf_document->ctx) {
> >  return ZATHURA_ERROR_UNKNOWN;
> >}
> > [...]
> IIUC I think that the comment is no longer valid for the 1.9 API and so
> it can be simplified to just call pdf_save_document() with NULL instead
> of passing `opts' (I'm using the patches attached here:
> )

Could you send an updated patch against zathura-pdf-mupdf's develop branch?
Ideally something easily git am-able.

Thanks
-- 
Sebastian Ramacher
___
zathura mailing list
zathura@lists.pwmt.org
https://lists.pwmt.org/mailman/listinfo/zathura


Re: [zathura] [PATCH 1/1] update API for mupdf 1.9

2016-05-13 Thread Leonardo Taccari
Hello Christian!

Christian Hesse writes:
> [...]
> --- a/document.c
> +++ b/document.c
> @@ -109,12 +109,12 @@ pdf_document_save_as(zathura_document_t* document, 
> mupdf_document_t*
>}
>  
>fz_try (mupdf_document->ctx) {
> -/* fz_write_document claims to accepts NULL as third argument but 
> doesn't.
> +/* pdf_save_document claims to accepts NULL as third argument but 
> doesn't.
>   * pdf_write_document does not check if the third arguments is NULL for 
> some
>   * options. */
>  
> -fz_write_options opts = { 0 }; /* just use the default options */
> -fz_write_document(mupdf_document->ctx, mupdf_document->document, (char*) 
> path, &opts);
> +pdf_write_options opts = { 0 }; /* just use the default options */
> +pdf_save_document(mupdf_document->ctx, (pdf_document*) 
> mupdf_document->document, (char*) path, &opts);
>} fz_catch (mupdf_document->ctx) {
>  return ZATHURA_ERROR_UNKNOWN;
>}
> [...]
IIUC I think that the comment is no longer valid for the 1.9 API and so
it can be simplified to just call pdf_save_document() with NULL instead
of passing `opts' (I'm using the patches attached here:
)


Ciao,
L.
___
zathura mailing list
zathura@lists.pwmt.org
https://lists.pwmt.org/mailman/listinfo/zathura