Mercurial > hg > orthanc
changeset 5343:cba09fd1e234
C89 compliance in sample basic plugin
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Wed, 28 Jun 2023 12:16:54 +0200 |
parents | 65d55cc86a41 |
children | f41e1f635c4d |
files | OrthancServer/Plugins/Samples/Basic/Plugin.c |
diffstat | 1 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/OrthancServer/Plugins/Samples/Basic/Plugin.c Wed Jun 28 11:54:41 2023 +0200 +++ b/OrthancServer/Plugins/Samples/Basic/Plugin.c Wed Jun 28 12:16:54 2023 +0200 @@ -293,6 +293,9 @@ else { OrthancPluginLoadDicomInstanceMode mode = OrthancPluginLoadDicomInstanceMode_WholeDicom; + OrthancPluginDicomInstance* instance; + char* json; + if (request->getCount == 1) { if (strcmp(request->getKeys[0], "until-pixel-data") == 0) @@ -309,16 +312,16 @@ } } - OrthancPluginDicomInstance* instance = OrthancPluginLoadDicomInstance(context, request->groups[0], mode); + instance = OrthancPluginLoadDicomInstance(context, request->groups[0], mode); if (instance == NULL) { return OrthancPluginErrorCode_UnknownResource; } - char* json = OrthancPluginEncodeDicomWebXml(context, - OrthancPluginGetInstanceData(context, instance), - OrthancPluginGetInstanceSize(context, instance), - DicomWebBinaryCallback); + json = OrthancPluginEncodeDicomWebXml(context, + OrthancPluginGetInstanceData(context, instance), + OrthancPluginGetInstanceSize(context, instance), + DicomWebBinaryCallback); OrthancPluginFreeDicomInstance(context, instance); if (json != NULL)